From 5f3cb5ad7738add23e21ad1912a2b8af068b100d Mon Sep 17 00:00:00 2001 From: Andy Green Date: Wed, 25 Nov 2020 19:45:33 +0000 Subject: [PATCH] ss: ss timeout also handle DISCONNECT_ME --- lib/secure-streams/secure-streams.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/secure-streams/secure-streams.c b/lib/secure-streams/secure-streams.c index a0ac75d1c..aecb0e3f0 100644 --- a/lib/secure-streams/secure-streams.c +++ b/lib/secure-streams/secure-streams.c @@ -1071,11 +1071,13 @@ lws_ss_to_cb(lws_sorted_usec_list_t *sul) lwsl_info("%s: ss %p timeout fired\n", __func__, h); r = lws_ss_event_helper(h, LWSSSCS_TIMEOUT); - if (r == LWSSSSRET_DESTROY_ME) { - if (h->wsi) - lws_set_timeout(h->wsi, 1, LWS_TO_KILL_ASYNC); - _lws_ss_handle_state_ret(r, NULL, &h); - } + if (r != LWSSSSRET_DISCONNECT_ME && r != LWSSSSRET_DESTROY_ME) + return; + + if (h->wsi) + lws_set_timeout(h->wsi, 1, LWS_TO_KILL_ASYNC); + + _lws_ss_handle_state_ret(r, NULL, &h); } void