Commit 0860c495 authored by Joel Martin's avatar Joel Martin Committed by Johannes Schindelin

websockets: Better disconnect detection.

If the only thing we are waiting on is a WebSockets terminator, then
remove it from the stream early on in rfbProcessClientNormalMessage.
Signed-off-by: 's avatarJohannes Schindelin <johannes.schindelin@gmx.de>
parent 6fac22a7
......@@ -1844,6 +1844,11 @@ rfbProcessClientNormalMessage(rfbClientPtr cl)
/* With Base64 encoding we need at least 4 bytes */
n = recv(cl->sock, encBuf, 4, MSG_PEEK);
if ((n > 0) && (n < 4)) {
if (encBuf[0] == '\xff') {
/* Make sure we don't miss a client disconnect on an end frame
* marker */
n = read(cl->sock, encBuf, 1);
}
return;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment