summaryrefslogtreecommitdiffstats
path: root/libvncserver/websockets.c
diff options
context:
space:
mode:
Diffstat (limited to 'libvncserver/websockets.c')
-rw-r--r--libvncserver/websockets.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libvncserver/websockets.c b/libvncserver/websockets.c
index 34f04d7..3585ed5 100644
--- a/libvncserver/websockets.c
+++ b/libvncserver/websockets.c
@@ -905,3 +905,16 @@ webSocketCheckDisconnect(rfbClientPtr cl)
return FALSE;
}
+/* returns TRUE if there is data waiting to be read in our internal buffer
+ * or if is there any pending data in the buffer of the SSL implementation
+ */
+rfbBool
+webSocketsHasDataInBuffer(rfbClientPtr cl)
+{
+ ws_ctx_t *wsctx = (ws_ctx_t *)cl->wsctx;
+
+ if (wsctx && wsctx->readbuflen)
+ return TRUE;
+
+ return (cl->sslctx && rfbssl_pending(cl) > 0);
+}