autobahn extend max ping pong close payload to 125
authorAndy Green <andy.green@linaro.org>
Mon, 28 Dec 2015 05:40:54 +0000 (13:40 +0800)
committerAndy Green <andy.green@linaro.org>
Mon, 28 Dec 2015 05:40:54 +0000 (13:40 +0800)
We only supported those specific control packet payloads up to 124.
125 is the correct limit.

Lws was consistent about the wrong limit so there are no other
issues.  It doesn't affect user ABI correcting it either.

Signed-off-by: Andy Green <andy.green@linaro.org>
lib/client-parser.c
lib/parsers.c
lib/private-libwebsockets.h

index 12096a4..845e6f4 100644 (file)
@@ -309,7 +309,7 @@ spill:
                        }
 
                        /* control packets can only be < 128 bytes long */
-                       if (wsi->u.ws.rx_user_buffer_head > 128 - 4) {
+                       if (wsi->u.ws.rx_user_buffer_head > 128 - 3) {
                                lwsl_parser("DROP PING payload too large\n");
                                goto ping_drop;
                        }
index adcdc29..ed36ecd 100644 (file)
@@ -1025,7 +1025,7 @@ spill:
                        }
 process_as_ping:
                        /* control packets can only be < 128 bytes long */
-                       if (wsi->u.ws.rx_user_buffer_head > 128 - 4) {
+                       if (wsi->u.ws.rx_user_buffer_head > 128 - 3) {
                                lwsl_parser("DROP PING payload too large\n");
                                goto ping_drop;
                        }
index 8647919..07fb2a1 100644 (file)
@@ -839,7 +839,7 @@ struct _lws_websocket_related {
        unsigned int rx_user_buffer_head;
        unsigned char mask_nonce[4];
        /* Also used for close content... control opcode == < 128 */
-       unsigned char ping_payload_buf[128 - 4 + LWS_SEND_BUFFER_PRE_PADDING];
+       unsigned char ping_payload_buf[128 - 3 + LWS_SEND_BUFFER_PRE_PADDING];
 
        unsigned char ping_payload_len;
        unsigned char frame_mask_index;