summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoni Poikelin <joni.poikelin@qt.io>2022-01-24 15:25:46 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-02-01 16:01:02 +0000
commit131a5a09e982c5df7f2b517d0ba3b70218ead150 (patch)
tree3a554911b7cf46c822868b8330c2e4bc28c585d8
parente0257868673791f328353b280d1ba01593f7f4ee (diff)
downloadqtwebsockets-131a5a09e982c5df7f2b517d0ba3b70218ead150.tar.gz
Fix order of signals around disconnection
readyRead() signal had been connected with QueuedConnection which caused disconnected() signal to sometimes come before last message signals of a connection. Reasoning for this was some issue regarding SSL sockets, but there is a good chance it has been fixed since then. Removing this doesn't seem to cause hangs now at least. Fixes: QTBUG-100054 Change-Id: Id465916d111a5520f4039cf57f822918f3afbca0 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> (cherry picked from commit e1c92b57485e685bac6884cca43e152faf9d2d2b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/websockets/qwebsocket_p.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/websockets/qwebsocket_p.cpp b/src/websockets/qwebsocket_p.cpp
index 3bac193..6bc700b 100644
--- a/src/websockets/qwebsocket_p.cpp
+++ b/src/websockets/qwebsocket_p.cpp
@@ -615,10 +615,8 @@ void QWebSocketPrivate::makeConnections(QTcpSocket *pTcpSocket)
//catch signals
QObjectPrivate::connect(pTcpSocket, &QAbstractSocket::stateChanged, this,
&QWebSocketPrivate::processStateChanged);
- //!!!important to use a QueuedConnection here;
- //with QTcpSocket there is no problem, but with QSslSocket the processing hangs
QObjectPrivate::connect(pTcpSocket, &QAbstractSocket::readyRead, this,
- &QWebSocketPrivate::processData, Qt::QueuedConnection);
+ &QWebSocketPrivate::processData);
#ifndef QT_NO_SSL
const QSslSocket * const sslSocket = qobject_cast<const QSslSocket *>(pTcpSocket);
if (sslSocket) {