From da38af3b2d0ced9ed3871c752f07974ab7df0c86 Mon Sep 17 00:00:00 2001 From: Sakthi Kannan Date: Mon, 11 May 2020 14:52:31 +0100 Subject: [PATCH] mqtt: avoid LRS_H1C_ISSUE_HANDSHAKE Otherwise we can get the client connection stalling since H1C has no meaning on mqtt. --- lib/roles/http/client/client-handshake.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/roles/http/client/client-handshake.c b/lib/roles/http/client/client-handshake.c index 780c97bce..c5867178f 100644 --- a/lib/roles/http/client/client-handshake.c +++ b/lib/roles/http/client/client-handshake.c @@ -196,6 +196,13 @@ send_hs: /* we are making our own connection */ + if (!rawish) + lwsi_set_state(wsi, LRS_H1C_ISSUE_HANDSHAKE); + else { + /* for a method = "RAW" connection, this makes us + * established */ + + #if defined(LWS_WITH_TLS) && !defined(LWS_WITH_MBEDTLS) /* we have connected if we got here */ @@ -226,18 +233,10 @@ send_hs: lws_set_timeout(wsi, PENDING_TIMEOUT_AWAITING_CLIENT_HS_SEND, wsi->context->timeout_secs); - //if () return wsi; } #endif - if (!rawish) - lwsi_set_state(wsi, LRS_H1C_ISSUE_HANDSHAKE); - else { - /* for a method = "RAW" connection, this makes us - * established */ - - /* clear his established timeout */ lws_set_timeout(wsi, NO_PENDING_TIMEOUT, 0);