{"schema":"libjg2-1",
"vpath":"/git/",
"avatar":"/git/avatar/",
"alang":"",
"gen_ut":1752321248,
"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":"42d82e62e53376d117fa70ab693f96db",
"commit": {"type":"commit",
"time": 1564510655,
"time_ofs": 60,
"oid_tree": { "oid": "2db9835f676b80d6a7c9adbd5705fac2f9e92686", "alias": []},
"oid":{ "oid": "431e4e82e1b884e999e5c6a1c1f6e08f7daac21d", "alias": []},
"msg": "ws: pass noncompressed server RX of zero length",
"sig_commit": { "git_time": { "time": 1564510655, "offset": 60 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },
"sig_author": { "git_time": { "time": 1564510337, "offset": 60 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }},
"body": "ws: pass noncompressed server RX of zero length"
,
"diff": "diff --git a/lib/roles/ws/ops-ws.c b/lib/roles/ws/ops-ws.c\nindex 4fbeb36..2550a14 100644\n--- a/lib/roles/ws/ops-ws.c\n+++ b/lib/roles/ws/ops-ws.c\n@@ -659,7 +659,8 @@ drain_extension:\n \t\t\trx_draining_ext \u003d wsi-\u003ews-\u003erx_draining_ext;\n #endif\n \n-\t\t\tif (wsi-\u003ews-\u003echeck_utf8 \u0026\u0026 !wsi-\u003ews-\u003edefeat_check_utf8) {\n+\t\t\tif (pmdrx.eb_out.len \u0026\u0026\n+\t\t\t wsi-\u003ews-\u003echeck_utf8 \u0026\u0026 !wsi-\u003ews-\u003edefeat_check_utf8) {\n \t\t\t\tif (lws_check_utf8(\u0026wsi-\u003ews-\u003eutf8,\n \t\t\t\t\t\t pmdrx.eb_out.token,\n \t\t\t\t\t\t pmdrx.eb_out.len)) {\ndiff --git a/lib/roles/ws/server-ws.c b/lib/roles/ws/server-ws.c\nindex 940b969..d987779 100644\n--- a/lib/roles/ws/server-ws.c\n+++ b/lib/roles/ws/server-ws.c\n@@ -783,13 +783,12 @@ lws_ws_frame_rest_is_payload(struct lws *wsi, uint8_t **buf, size_t len)\n \tn \u003d lws_ext_cb_active(wsi, LWS_EXT_CB_PAYLOAD_RX, \u0026pmdrx, 0);\n \tlwsl_info(\u0022%s: ext says %d / ebuf_out.len %d\u005cn\u0022, __func__, n,\n \t\t\tpmdrx.eb_out.len);\n-#endif\n+\n \t/*\n \t * ebuf may be pointing somewhere completely different now,\n \t * it's the output\n \t */\n \n-#if !defined(LWS_WITHOUT_EXTENSIONS)\n \tif (n \u003c 0) {\n \t\t/*\n \t\t * we may rely on this to get RX, just drop connection\n@@ -799,9 +798,7 @@ lws_ws_frame_rest_is_payload(struct lws *wsi, uint8_t **buf, size_t len)\n \n \t\treturn -1;\n \t}\n-#endif\n \n-#if !defined(LWS_WITHOUT_EXTENSIONS)\n \t/*\n \t * if we had an rx fragment right at the last compressed byte of the\n \t * message, we can get a zero length inflated output, where no prior\n@@ -829,12 +826,14 @@ lws_ws_frame_rest_is_payload(struct lws *wsi, uint8_t **buf, size_t len)\n \n \t\treturn avail;\n \t}\n-#endif\n \n-\tif (!pmdrx.eb_out.len)\n+\t/*\n+\t * If doing permessage-deflate, above was the only way to get a zero\n+\t * length receive. Otherwise we're more willing.\n+\t */\n+\tif (wsi-\u003ews-\u003ecount_act_ext \u0026\u0026 !pmdrx.eb_out.len)\n \t\treturn avail;\n \n-#if !defined(LWS_WITHOUT_EXTENSIONS)\n \tif (n \u003d\u003d PMDR_HAS_PENDING)\n \t\t/* extension had more... main loop will come back */\n \t\tlws_add_wsi_to_draining_ext_list(wsi);\n@@ -842,7 +841,8 @@ lws_ws_frame_rest_is_payload(struct lws *wsi, uint8_t **buf, size_t len)\n \t\tlws_remove_wsi_from_draining_ext_list(wsi);\n #endif\n \n-\tif (wsi-\u003ews-\u003echeck_utf8 \u0026\u0026 !wsi-\u003ews-\u003edefeat_check_utf8) {\n+\tif (pmdrx.eb_out.len \u0026\u0026\n+\t wsi-\u003ews-\u003echeck_utf8 \u0026\u0026 !wsi-\u003ews-\u003edefeat_check_utf8) {\n \t\tif (lws_check_utf8(\u0026wsi-\u003ews-\u003eutf8,\n \t\t\t\t pmdrx.eb_out.token,\n \t\t\t\t pmdrx.eb_out.len)) {\n","s":{"c":1752321248,"u": 3729}}
],"g": 5090,"chitpc": 0,"ehitpc": 0,"indexed":0
,
"ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}