From 5c24f1edada6107e7796f8e9df2d2b4d619a4712 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Thu, 10 Feb 2022 05:58:48 +0000 Subject: [PATCH] ss: avoid POLL-POLL transition --- lib/secure-streams/secure-streams.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/secure-streams/secure-streams.c b/lib/secure-streams/secure-streams.c index e4f1dbcd8..5572d5442 100644 --- a/lib/secure-streams/secure-streams.c +++ b/lib/secure-streams/secure-streams.c @@ -1595,9 +1595,12 @@ _lws_ss_request_tx(lws_ss_handle_t *h) return LWSSSSRET_OK; h->seqstate = SSSEQ_TRY_CONNECT; - r = lws_ss_event_helper(h, LWSSSCS_POLL); - if (r) - return r; + if (h->prev_ss_state != LWSSSCS_POLL) { /* possible if we were created + * before we could action it */ + r = lws_ss_event_helper(h, LWSSSCS_POLL); + if (r) + return r; + } /* * Retries operate via lws_ss_request_tx(), explicitly ask for a