From eba2d5cabd840db0c931a5962df63cb8a00c34b7 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Fri, 19 Mar 2021 20:29:22 +0000 Subject: [PATCH] ws: wsi unusability only applies when no pending We basically hear about HUP out-of-band with respect to pending rx... now we mark the wsi as "unusable" once we see the HUP - the connection has ended. This means we have to differentiate between the wsi being unusable for new things now, like replying, and what it has already sent still being servicible and pending. --- lib/roles/ws/client-parser-ws.c | 8 -------- lib/roles/ws/ops-ws.c | 3 --- 2 files changed, 11 deletions(-) diff --git a/lib/roles/ws/client-parser-ws.c b/lib/roles/ws/client-parser-ws.c index 7bf38a8b7..b578f0f2e 100644 --- a/lib/roles/ws/client-parser-ws.c +++ b/lib/roles/ws/client-parser-ws.c @@ -57,14 +57,6 @@ int lws_ws_client_rx_sm(struct lws *wsi, unsigned char c) } #endif - /* - * Peer may have closed, but that doesn't necessarily mean we should not - * parse any rx we have from them. - * - if (wsi->socket_is_permanently_unusable) - return -1; - */ - switch (wsi->lws_rx_parse_state) { case LWS_RXPS_NEW: /* control frames (PING) may interrupt checkable sequences */ diff --git a/lib/roles/ws/ops-ws.c b/lib/roles/ws/ops-ws.c index fc1bfe7fb..08299ca62 100644 --- a/lib/roles/ws/ops-ws.c +++ b/lib/roles/ws/ops-ws.c @@ -50,9 +50,6 @@ lws_ws_rx_sm(struct lws *wsi, char already_processed, unsigned char c) pmdrx.eb_out.token = NULL; pmdrx.eb_out.len = 0; - if (wsi->socket_is_permanently_unusable) - return -1; - switch (wsi->lws_rx_parse_state) { case LWS_RXPS_NEW: #if !defined(LWS_WITHOUT_EXTENSIONS)