{"schema":"libjg2-1",
"vpath":"/git/",
"avatar":"/git/avatar/",
"alang":"",
"gen_ut":1711697664,
"reponame":"libwebsockets",
"desc":"libwebsockets lightweight C networking library",
"owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://libwebsockets.org/repo/libwebsockets",
"f":3,
"items": [
{"schema":"libjg2-1",
"cid":"1e130d9a9443e14b3f641bd1faf88d8e",
"commit": {"type":"commit",
"time": 1509845820,
"time_ofs": 480,
"oid_tree": { "oid": "1f90005e5ca069f61fad2eff412dac2e0447e246", "alias": []},
"oid":{ "oid": "d2ec329531836e0e6caaff5a1ece459074cc2bba", "alias": []},
"msg": "rxflow: fix second draining path",
"sig_commit": { "git_time": { "time": 1509845820, "offset": 480 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },
"sig_author": { "git_time": { "time": 1509837053, "offset": 480 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }},
"body": "rxflow: fix second draining path\n"
,
"diff": "diff --git a/lib/server/parsers.c b/lib/server/parsers.c\nindex 5e018aa..fb345ab 100644\n--- a/lib/server/parsers.c\n+++ b/lib/server/parsers.c\n@@ -1504,14 +1504,12 @@ handle_first:\n \t\t * if there's no protocol max frame size given, we are\n \t\t * supposed to default to context-\u003ept_serv_buf_size\n \t\t */\n-\n \t\tif (!wsi-\u003eprotocol-\u003erx_buffer_size \u0026\u0026\n \t\t wsi-\u003eu.ws.rx_ubuf_head !\u003d wsi-\u003econtext-\u003ept_serv_buf_size)\n \t\t\tbreak;\n-\t\telse\n-\t\t\tif (wsi-\u003eprotocol-\u003erx_buffer_size \u0026\u0026\n-\t\t\t\t\twsi-\u003eu.ws.rx_ubuf_head !\u003d\n-\t\t\t\t\t\t wsi-\u003eprotocol-\u003erx_buffer_size)\n+\n+\t\tif (wsi-\u003eprotocol-\u003erx_buffer_size \u0026\u0026\n+\t\t wsi-\u003eu.ws.rx_ubuf_head !\u003d wsi-\u003eprotocol-\u003erx_buffer_size)\n \t\t\tbreak;\n \n \t\t/* spill because we filled our rx buffer */\ndiff --git a/lib/server/server.c b/lib/server/server.c\nindex 27237a9..b06ab68 100644\n--- a/lib/server/server.c\n+++ b/lib/server/server.c\n@@ -2867,18 +2867,31 @@ lws_interpret_incoming_packet(struct lws *wsi, unsigned char **buf, size_t len)\n \t\t/* account for what we're using in rxflow buffer */\n \t\tif (wsi-\u003erxflow_buffer) {\n \t\t\twsi-\u003erxflow_pos++;\n-\t\t\tassert(wsi-\u003erxflow_pos \u003c\u003d wsi-\u003erxflow_len);\n+\t\t\tif (wsi-\u003erxflow_pos \u003e wsi-\u003erxflow_len) {\n+\t\t\t\tlwsl_err(\u0022bumped rxflow buffer too far (%d / %d)\u0022, wsi-\u003erxflow_pos, wsi-\u003erxflow_len);\n+\t\t\t\tassert(0);\n+\t\t\t}\n \t\t}\n \n \t\t/* consume payload bytes efficiently */\n-\t\tif (\n-\t\t wsi-\u003elws_rx_parse_state \u003d\u003d\n+\t\tif (wsi-\u003elws_rx_parse_state \u003d\u003d\n \t\t LWS_RXPS_PAYLOAD_UNTIL_LENGTH_EXHAUSTED) {\n \t\t\tm \u003d lws_payload_until_length_exhausted(wsi, buf, \u0026len);\n \t\t\tif (wsi-\u003erxflow_buffer)\n \t\t\t\twsi-\u003erxflow_pos +\u003d m;\n \t\t}\n \n+\t\tif (wsi-\u003erxflow_buffer \u0026\u0026 wsi-\u003erxflow_pos \u003d\u003d wsi-\u003erxflow_len) {\n+\t\t\tlwsl_debug(\u0022%s: %p flow buf: drained\u005cn\u0022, __func__, wsi);\n+\t\t\tlws_free_set_NULL(wsi-\u003erxflow_buffer);\n+\t\t\t/* having drained the rxflow buffer, can rearm POLLIN */\n+#ifdef LWS_NO_SERVER\n+\t\t\tm \u003d\n+#endif\n+\t\t\t_lws_rx_flow_control(wsi);\n+\t\t\t/* m ignored, needed for NO_SERVER case */\n+\t\t}\n+\n \t\t/* process the byte */\n \t\tm \u003d lws_rx_sm(wsi, *(*buf)++);\n \t\tif (m \u003c 0)\n","s":{"c":1711697664,"u": 7373}}
],"g": 8118,"chitpc": 0,"ehitpc": 0,"indexed":0
,
"ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}