]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix for firefox secure websockets which for some reason writes only 1 byte first...
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 7 Feb 2013 23:47:04 +0000 (17:47 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 1 Apr 2013 02:27:24 +0000 (21:27 -0500)
libs/sofia-sip/libsofia-sip-ua/tport/ws.c

index 65fa826e1c50221b176cb25b0d40f994cead486b..afbf80923d8447b991eba128ab8f1c817fdecede 100644 (file)
@@ -441,8 +441,10 @@ ssize_t ws_read_frame(wsh_t *wsh, ws_opcode_t *oc, uint8_t **data)
        }
 
        if ((wsh->datalen = ws_raw_read(wsh, wsh->buffer, 14)) < need) {
-               /* too small - protocol err */
-               return ws_close(wsh, WS_PROTO_ERR);
+               if ((wsh->datalen += ws_raw_read(wsh, wsh->buffer + wsh->datalen, 14 - wsh->datalen)) < need) {
+                       /* too small - protocol err */
+                       return ws_close(wsh, WS_PROTO_ERR);
+               }
        }
 
        *oc = *wsh->buffer & 0xf;