summaryrefslogtreecommitdiffstats
path: root/libvncserver/main.c
diff options
context:
space:
mode:
authorFloris Bos <bos@je-eigen-domein.nl>2015-01-17 22:49:48 +0100
committerFloris Bos <bos@je-eigen-domein.nl>2015-01-17 22:49:48 +0100
commit6836ccb208f8c16824b8c1e330acb077c70c98c6 (patch)
tree0be8f48f5160109fc10b19f5f9f90fbfd9e97c0e /libvncserver/main.c
parenta48035a1ce6b5fa9738e9f1762294ddfe52b8d57 (diff)
downloadlibtdevnc-6836ccb208f8c16824b8c1e330acb077c70c98c6.tar.gz
libtdevnc-6836ccb208f8c16824b8c1e330acb077c70c98c6.zip
Fix handling of multiple VNC commands per websockets frame
- When processing input, check if there is any extra data pending in the internal websocket frame and SSL buffers. - Prevents input events lagging behind because they get stuck in one of the buffers. Data pending in our own buffers cannot be detected with select() so was not processed until more input arrives from the network. - Closes # 55 Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
Diffstat (limited to 'libvncserver/main.c')
-rw-r--r--libvncserver/main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libvncserver/main.c b/libvncserver/main.c
index 9839c85..a8458e4 100644
--- a/libvncserver/main.c
+++ b/libvncserver/main.c
@@ -550,7 +550,15 @@ clientInput(void *data)
rfbSendFileTransferChunk(cl);
if (FD_ISSET(cl->sock, &rfds) || FD_ISSET(cl->sock, &efds))
+ {
+#ifdef LIBVNCSERVER_WITH_WEBSOCKETS
+ do {
+ rfbProcessClientMessage(cl);
+ } while (webSocketsHasDataInBuffer(cl));
+#else
rfbProcessClientMessage(cl);
+#endif
+ }
}
/* Get rid of the output thread. */