aboutsummaryrefslogtreecommitdiffstats
path: root/src/websockets/qwebsocket_p.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/websockets/qwebsocket_p.cpp')
-rw-r--r--src/websockets/qwebsocket_p.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/websockets/qwebsocket_p.cpp b/src/websockets/qwebsocket_p.cpp
index 9b94d04..36aefd9 100644
--- a/src/websockets/qwebsocket_p.cpp
+++ b/src/websockets/qwebsocket_p.cpp
@@ -113,6 +113,7 @@ QWebSocketPrivate::QWebSocketPrivate(const QString &origin, QWebSocketProtocol::
m_defaultMaskGenerator(),
m_handshakeState(NothingDoneState)
{
+ m_pingTimer.start();
}
/*!
@@ -144,6 +145,7 @@ QWebSocketPrivate::QWebSocketPrivate(QTcpSocket *pTcpSocket, QWebSocketProtocol:
m_defaultMaskGenerator(),
m_handshakeState(NothingDoneState)
{
+ m_pingTimer.start();
}
/*!
@@ -1173,13 +1175,13 @@ void QWebSocketPrivate::processData()
{
if (!m_pSocket) // disconnected with data still in-bound
return;
- if (m_pSocket->bytesAvailable()) {
+ while (m_pSocket->bytesAvailable()) {
if (state() == QAbstractSocket::ConnectingState) {
if (!m_pSocket->canReadLine())
return;
processHandshake(m_pSocket);
- } else {
- m_dataProcessor.process(m_pSocket);
+ } else if (!m_dataProcessor.process(m_pSocket)) {
+ return;
}
}
}