mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-26 06:32:44 +00:00
websocket: Fix updating remaining bytes to write in websocket_write
"len" is not always the full remainder (consider the case when we are writing a partial frame). Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Jeremy White <jwhite@codeweavers.com>
This commit is contained in:
parent
9f1417c11f
commit
0c2f386beb
@ -478,10 +478,8 @@ int websocket_write(RedsWebSocket *ws, const void *buf, size_t len)
|
||||
}
|
||||
|
||||
rc = ws->raw_write(ws->raw_stream, buf, len);
|
||||
if (rc <= 0) {
|
||||
ws->write_remainder = len;
|
||||
} else {
|
||||
ws->write_remainder = len - rc;
|
||||
if (rc > 0) {
|
||||
ws->write_remainder -= rc;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user