Commit 1408866c authored by Gernot Tenchio's avatar Gernot Tenchio

websockets: Initial HyBi support

parent 02651bac
......@@ -365,8 +365,6 @@ rfbNewTCPOrUDPClient(rfbScreenInfoPtr rfbScreen,
#ifdef LIBVNCSERVER_WITH_WEBSOCKETS
cl->webSockets = FALSE;
cl->webSocketsBase64 = FALSE;
cl->dblen= 0;
cl->carrylen = 0;
#endif
#if defined(LIBVNCSERVER_HAVE_LIBZ) || defined(LIBVNCSERVER_HAVE_LIBPNG)
......
......@@ -647,11 +647,12 @@ rfbWriteExact(rfbClientPtr cl,
#ifdef LIBVNCSERVER_WITH_WEBSOCKETS
if (cl->webSockets) {
if ((len = webSocketsEncode(cl, buf, len)) < 0) {
char *tmp = NULL;
if ((len = webSocketsEncode(cl, buf, len, &tmp)) < 0) {
rfbErr("WriteExact: WebSockets encode error\n");
return -1;
}
buf = cl->encodeBuf;
buf = tmp;
}
#endif
......
This diff is collapsed.
......@@ -419,6 +419,7 @@ typedef struct _rfbStatList {
} rfbStatList;
typedef struct _rfbSslCtx rfbSslCtx;
typedef struct _wsCtx wsCtx;
typedef struct _rfbClientRec {
......@@ -640,17 +641,10 @@ typedef struct _rfbClientRec {
#ifdef LIBVNCSERVER_WITH_WEBSOCKETS
rfbBool webSockets;
rfbBool webSocketsSSL;
rfbBool webSocketsBase64;
rfbSslCtx *sslctx;
wsCtx *wsctx;
char *wspath; /* Requests path component */
char encodeBuf[UPDATE_BUF_SIZE*2 + 2]; /* UTF-8 could double it + framing */
char decodeBuf[8192]; /* TODO: what makes sense? */
int dblen;
char carryBuf[3]; /* For base64 carry-over */
int carrylen;
#endif
} rfbClientRec, *rfbClientPtr;
......@@ -718,7 +712,7 @@ extern rfbBool rfbSetNonBlocking(int sock);
/* websockets.c */
extern rfbBool webSocketsCheck(rfbClientPtr cl);
extern int webSocketsEncode(rfbClientPtr cl, const char *src, int len);
extern int webSocketsEncode(rfbClientPtr cl, const char *src, int len, char **dst);
extern int webSocketsDecode(rfbClientPtr cl, char *dst, int len);
#endif
......
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