Skip to content

Commit 2095b20

Browse files
committed
proxy: ws: handle case onward conn closes during upgrade
Co-developed-by: Gemini 2.5 Pro
1 parent 0b69a85 commit 2095b20

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

lib/core-net/dummy-callback.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,13 @@ lws_callback_ws_proxy(struct lws *wsi, enum lws_callback_reasons reason,
121121
if (!wsi->h1_ws_proxied || !wsi->parent)
122122
break;
123123

124+
/*
125+
* If the parent has started to close, don't try to
126+
* upgrade it, just let it go.
127+
*/
128+
if (lwsi_state(wsi->parent) >= LRS_RETURNED_CLOSE)
129+
return -1;
130+
124131
if (lws_process_ws_upgrade2(wsi->parent))
125132
return -1;
126133

0 commit comments

Comments
 (0)