{"schema":"libjg2-1",
"vpath":"/git/",
"avatar":"/git/avatar/",
"alang":"",
"gen_ut":1754202734,
"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":"0b2e5242d3c46c904ec50040a64769c2",
"commit": {"type":"commit",
"time": 1648196309,
"time_ofs": 0,
"oid_tree": { "oid": "d5433c277f0c21d9446408dee953ad77bd6071d1", "alias": []},
"oid":{ "oid": "497e25df836adf8ddc6fb274550944cff387097f", "alias": []},
"msg": "ss: http: facilitate back-to-back transactions",
"sig_commit": { "git_time": { "time": 1648196309, "offset": 0 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },
"sig_author": { "git_time": { "time": 1646155979, "offset": 0 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }},
"body": "ss: http: facilitate back-to-back transactions\n\nWe need to insert a CONNECTING state if we're going again.\n\n"
,
"diff": "diff --git a/lib/core-net/close.c b/lib/core-net/close.c\nindex 1319ad2..94f9858 100644\n--- a/lib/core-net/close.c\n+++ b/lib/core-net/close.c\n@@ -349,6 +349,9 @@ __lws_close_free_wsi(struct lws *wsi, enum lws_close_status reason,\n {\n \tstruct lws_context_per_thread *pt;\n \tconst struct lws_protocols *pro;\n+#if defined(LWS_WITH_SECURE_STREAMS)\n+\tlws_ss_handle_t *hh \u003d NULL;\n+#endif\n \tstruct lws_context *context;\n \tstruct lws *wsi1, *wsi2;\n \tint n, ccb;\n@@ -842,25 +845,18 @@ async_close:\n \t\t\t} else\n #endif\n \t\t{\n-\t\t\tlws_ss_handle_t *h \u003d (lws_ss_handle_t *)wsi-\u003ea.opaque_user_data;\n+\t\t\thh \u003d (lws_ss_handle_t *)wsi-\u003ea.opaque_user_data;\n \n-\t\t\tif (h) { // \u0026\u0026 (h-\u003einfo.flags \u0026 LWSSSINFLAGS_ACCEPTED)) {\n+\t\t\tif (hh) { // \u0026\u0026 (h-\u003einfo.flags \u0026 LWSSSINFLAGS_ACCEPTED)) {\n \n \t\t\t\t/*\n \t\t\t\t * ss level: only reports if dangling caliper\n \t\t\t\t * not already reported\n \t\t\t\t */\n-\t\t\t\tlws_metrics_caliper_report_hist(h-\u003ecal_txn, wsi);\n+\t\t\t\tlws_metrics_caliper_report_hist(hh-\u003ecal_txn, wsi);\n \n-\t\t\t\th-\u003ewsi \u003d NULL;\n+\t\t\t\thh-\u003ewsi \u003d NULL;\n \t\t\t\twsi-\u003ea.opaque_user_data \u003d NULL;\n-\n-\t\t\t\tif (h-\u003ess_dangling_connected \u0026\u0026\n-\t\t\t\t lws_ss_event_helper(h, LWSSSCS_DISCONNECTED) \u003d\u003d\n-\t\t\t\t\t\t LWSSSSRET_DESTROY_ME) {\n-\n-\t\t\t\t\tlws_ss_destroy(\u0026h);\n-\t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n@@ -875,6 +871,12 @@ async_close:\n \t\t\treturn;\n \n \t__lws_close_free_wsi_final(wsi);\n+\n+#if defined(LWS_WITH_SECURE_STREAMS)\n+\tif (hh \u0026\u0026 hh-\u003ess_dangling_connected \u0026\u0026\n+\t lws_ss_event_helper(hh, LWSSSCS_DISCONNECTED) \u003d\u003d LWSSSSRET_DESTROY_ME)\n+\t\tlws_ss_destroy(\u0026hh);\n+#endif\n }\n \n \ndiff --git a/lib/secure-streams/protocols/ss-h1.c b/lib/secure-streams/protocols/ss-h1.c\nindex f53a7b1..707ed8c 100644\n--- a/lib/secure-streams/protocols/ss-h1.c\n+++ b/lib/secure-streams/protocols/ss-h1.c\n@@ -653,6 +653,16 @@ secstream_h1(struct lws *wsi, enum lws_callback_reasons reason, void *user,\n \n \t\tif (h-\u003eprev_ss_state !\u003d LWSSSCS_CONNECTED) {\n \t\t\twsi-\u003eclient_suppress_CONNECTION_ERROR \u003d 1;\n+\t\t\t/*\n+\t\t\t * back-to-back http transactions otherwise go\n+\t\t\t * DISCONNECTED -\u003e CONNECTED, we should insert\n+\t\t\t * CONNECTING inbetween\n+\t\t\t */\n+\t\t\tif (h-\u003eprev_ss_state \u003d\u003d LWSSSCS_DISCONNECTED) {\n+\t\t\t\tr \u003d lws_ss_event_helper(h, LWSSSCS_CONNECTING);\n+\t\t\t\tif (r !\u003d LWSSSSRET_OK)\n+\t\t\t\t\treturn _lws_ss_handle_state_ret_CAN_DESTROY_HANDLE(r, wsi, \u0026h);\n+\t\t\t}\n \t\t\tif (h-\u003eprev_ss_state !\u003d LWSSSCS_CONNECTED) {\n \t\t\t\tr \u003d lws_ss_event_helper(h, LWSSSCS_CONNECTED);\n \t\t\t\tif (r !\u003d LWSSSSRET_OK)\ndiff --git a/lib/secure-streams/secure-streams.c b/lib/secure-streams/secure-streams.c\nindex ad49316..24f3de9 100644\n--- a/lib/secure-streams/secure-streams.c\n+++ b/lib/secure-streams/secure-streams.c\n@@ -415,9 +415,22 @@ lws_ss_event_helper(lws_ss_handle_t *h, lws_ss_constate_t cs)\n \n \tif (cs \u003d\u003d LWSSSCS_CONNECTED)\n \t\th-\u003ess_dangling_connected \u003d 1;\n-\tif (cs \u003d\u003d LWSSSCS_DISCONNECTED)\n+\tif (cs \u003d\u003d LWSSSCS_DISCONNECTED) {\n \t\th-\u003ess_dangling_connected \u003d 0;\n \n+\t\th-\u003esubseq \u003d 0;\n+\t\th-\u003etxn_ok \u003d 0;\n+\t\th-\u003etxn_resp_set \u003d 0;\n+\t\th-\u003etxn_resp_pending \u003d 0;\n+\t\th-\u003ehanging_som \u003d 0;\n+\t\th-\u003einside_msg \u003d 0;\n+\t\th-\u003einside_connect \u003d 0;\n+\t\th-\u003eproxy_onward \u003d 0;\n+\t\th-\u003ewsi \u003d NULL;\n+\t\th-\u003eu.http.good_respcode \u003d 0;\n+\t\th-\u003eseqstate \u003d SSSEQ_IDLE;\n+\t}\n+\n \tif (h-\u003einfo.state) {\n \t\th-\u003eh_in_svc \u003d h;\n \t\tr \u003d h-\u003einfo.state(ss_to_userobj(h), NULL, cs,\n","s":{"c":1754202734,"u": 30065}}
],"g": 31159,"chitpc": 0,"ehitpc": 0,"indexed":0
,
"ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}