1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-23 00:00:06 +01:00

ws: correctly handle ESTABLISHED rejecting connection

https://github.com/warmcat/libwebsockets/issues/1973
This commit is contained in:
Andy Green 2020-07-14 19:40:11 +01:00
parent b6b3f7033c
commit d1fa3dcfa8
3 changed files with 7 additions and 3 deletions

View file

@ -327,7 +327,7 @@ set(PACKAGE "libwebsockets")
set(CPACK_PACKAGE_NAME "${PACKAGE}")
set(CPACK_PACKAGE_VERSION_MAJOR "4")
set(CPACK_PACKAGE_VERSION_MINOR "0")
set(CPACK_PACKAGE_VERSION_PATCH "21")
set(CPACK_PACKAGE_VERSION_PATCH "22")
set(CPACK_PACKAGE_RELEASE 1)
set(CPACK_GENERATOR "RPM")
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")

View file

@ -112,7 +112,8 @@ lws_callback_ws_proxy(struct lws *wsi, enum lws_callback_reasons reason,
if (!wsi->h1_ws_proxied || !wsi->parent)
break;
lws_process_ws_upgrade2(wsi->parent);
if (lws_process_ws_upgrade2(wsi->parent))
return -1;
#if defined(LWS_WITH_HTTP2)
if (wsi->parent->mux_substream)

View file

@ -376,7 +376,10 @@ lws_process_ws_upgrade2(struct lws *wsi)
break;
}
lws_server_init_wsi_for_ws(wsi);
if (lws_server_init_wsi_for_ws(wsi)) {
lwsl_notice("%s: user ESTABLISHED failed connection\n", __func__);
return 1;
}
lwsl_parser("accepted v%02d connection\n", wsi->ws->ietf_spec_revision);
#if defined(LWS_WITH_ACCESS_LOG)