fix(websockets): Close stream before attempting to connect again (#6805)

This commit is contained in:
Nerixyz
2026-02-14 12:51:40 +01:00
committed by GitHub
parent 57613cc2a4
commit a8edcdde62
2 changed files with 9 additions and 0 deletions
@@ -143,6 +143,14 @@ void WebSocketConnectionHelper<Derived, Inner>::onTcpHandshake(
qCDebug(chatterinoWebsocket)
<< *this << "error in tcp handshake" << ep.address().to_string()
<< ec.message();
beast::get_lowest_layer(this->stream).socket().close(ec);
if (ec)
{
qCDebug(chatterinoWebsocket)
<< *this << "closing websocket after error" << ec.message();
}
this->tryConnect(++endpointIterator);
return;
}