Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.5.1, 5.6.0
-
None
-
Windows, Linux, Mac
-
ba9306ec5a1271275d79b2f48ceb227f79352f33
Description
When opening connection QWebSocket sometimes hang up during handshake in QWebSocketPrivate::processData() due to the bad while condition: m_pSocket->bytesAvailable() is true but m_pSocket->canReadLine() is false, so processHandshake do nothing in state ReadingStatusState.
Bug fix, that is worked for me, would be adding single line - to break while during handshake if we can't read a line, because processHandshake reads only lines (all auto tests passed with this fix):
File: qwebsocket_p.cpp
void QWebSocketPrivate::processData() { Q_ASSERT(m_pSocket); while (m_pSocket->bytesAvailable()) { if (state() == QAbstractSocket::ConnectingState) { if (!m_pSocket->canReadLine()) break; // <-- bug fix processHandshake(m_pSocket); } else { m_dataProcessor.process(m_pSocket); } } }
Attachments
Issue Links
- is duplicated by
-
QTBUG-52557 WebSockets don't work on WinRT, connection time outs
- Closed