From 9ff83d9e75374269f1f2991f5e1e3b78ee2b0f71 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Thu, 16 Sep 2021 08:56:10 +0100 Subject: [PATCH] ss: h1: be sure to go through DISCONNECTING if CCE --- lib/secure-streams/protocols/ss-h1.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/secure-streams/protocols/ss-h1.c b/lib/secure-streams/protocols/ss-h1.c index 87b28c2bb..b2e383bc4 100644 --- a/lib/secure-streams/protocols/ss-h1.c +++ b/lib/secure-streams/protocols/ss-h1.c @@ -462,6 +462,12 @@ secstream_h1(struct lws *wsi, enum lws_callback_reasons reason, void *user, lws_metrics_caliper_report_hist(h->cal_txn, wsi); lwsl_info("%s: %s CLIENT_CONNECTION_ERROR: %s\n", __func__, h->lc.gutag, in ? (const char *)in : "none"); + if (h->ss_dangling_connected) { + /* already disconnected, no action for DISCONNECT_ME */ + r = lws_ss_event_helper(h, LWSSSCS_DISCONNECTED); + if (r != LWSSSSRET_OK) + return _lws_ss_handle_state_ret_CAN_DESTROY_HANDLE(r, wsi, &h); + } /* already disconnected, no action for DISCONNECT_ME */ r = lws_ss_event_helper(h, LWSSSCS_UNREACHABLE); if (r) {