Fix tunnel failing due to an unexpected event when connected 12/311712/1 accepted/tizen/unified/20240603.032352
authorKrzysztof Malysa <k.malysa@samsung.com>
Fri, 24 May 2024 09:07:19 +0000 (11:07 +0200)
committerKrzysztof Malysa <k.malysa@samsung.com>
Fri, 24 May 2024 09:09:10 +0000 (11:09 +0200)
Change-Id: Ic714e2659b6fca1305d04462a7fd940b2f683a6a

srcs/tunnel.cpp

index e9ac8a0236e7b4fd38831b5896d4927e4a6286ac..61cefab06e63fcd1aa84b1955c876bec8d7899ca 100644 (file)
@@ -424,8 +424,9 @@ bool Tunnel::HandleEvent(Lws *wsi, enum lws_callback_reasons reason, void *in, s
             }
             if (m_state == State::WILL_DISCONNECT)
                 return true;
-            // LWS_CALLBACK_EVENT_WAIT_CANCELLED may happen during successful connecting
-            if (m_state != State::DISCONNECTED) {
+            // LWS_CALLBACK_EVENT_WAIT_CANCELLED may happen during successful connecting. It was
+            // also seen between writing and reading from the connected tunnel.
+            if (m_state != State::DISCONNECTED && m_state != State::CONNECTED) {
                 LogError("Unexpected event");
                 m_state = State::FAILED;
                 return true;