diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2022-10-13 14:24:54 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2022-10-13 14:24:54 +0200 |
commit | a5d243cac235709093ee6d77f85836a8dd6dc17e (patch) | |
tree | d46d427bbf5b671af42aa061e0762d45b9302c41 /modules/websocket | |
parent | fd4572cc45506f901e68a2cb485f44ffd01b937e (diff) |
[WebSocket] Fix TCP connection being closed while connecting.
Fix a bug causing the WebSocketPeer to fail connecting to a remote
server when the TCP 3-way handshake took more than a few milliseconds.
Diffstat (limited to 'modules/websocket')
-rw-r--r-- | modules/websocket/wsl_peer.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/websocket/wsl_peer.cpp b/modules/websocket/wsl_peer.cpp index 4c8e661f67..4930b178ec 100644 --- a/modules/websocket/wsl_peer.cpp +++ b/modules/websocket/wsl_peer.cpp @@ -104,6 +104,8 @@ void WSLPeer::Resolver::try_next_candidate(Ref<StreamPeerTCP> &p_tcp) { p_tcp->set_no_delay(true); ip_candidates.clear(); return; + } else if (status == StreamPeerTCP::STATUS_CONNECTING) { + return; // Keep connecting. } else { p_tcp->disconnect_from_host(); } |