From cfb076c8a0a40337e867b0a2be66a258f05f17c5 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Wed, 3 Jan 2018 09:11:27 +0800 Subject: [PATCH] hs: close immediately if negotation failed --- lib/service.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/service.c b/lib/service.c index a44e2cb3..b90ffcb3 100644 --- a/lib/service.c +++ b/lib/service.c @@ -1797,6 +1797,14 @@ drain: break; } #endif + /* + * something went wrong with parsing the handshake, and + * we ended up back in the event loop without completing it + */ + case LWSCM_PRE_WS_SERVING_ACCEPT: + wsi->socket_is_permanently_unusable = 1; + goto close_and_handled; + default: #ifdef LWS_NO_CLIENT break;