summaryrefslogtreecommitdiff
path: root/src/websockets/qwebsocket_p.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>2014-11-03 13:48:18 +0100
committerOswald Buddenhagen <oswald.buddenhagen@digia.com>2014-11-03 13:48:23 +0100
commit44a071396e91de32eb3efd12a1ed230ed1632aea (patch)
treec6e514d3dd1e1503bb6df0eaa12714e97b8d625e /src/websockets/qwebsocket_p.cpp
parent0854eda408de542047a0ef38c37953719a8f9fde (diff)
parent7aeea581882425be657123d2945c7165c7063aab (diff)
downloadqtwebsockets-44a071396e91de32eb3efd12a1ed230ed1632aea.tar.gz
Merge remote-tracking branch 'origin/5.3' into 5.4
Change-Id: I0e89ede5ea173f2e831c42d250ddb2b21b42b89b
Diffstat (limited to 'src/websockets/qwebsocket_p.cpp')
-rw-r--r--src/websockets/qwebsocket_p.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/websockets/qwebsocket_p.cpp b/src/websockets/qwebsocket_p.cpp
index b9d37a1..f483e12 100644
--- a/src/websockets/qwebsocket_p.cpp
+++ b/src/websockets/qwebsocket_p.cpp
@@ -384,12 +384,6 @@ void QWebSocketPrivate::open(const QUrl &url, bool mask)
m_pSocket->setPauseMode(m_pauseMode);
makeConnections(m_pSocket.data());
- QObject::connect(sslSocket, &QSslSocket::encryptedBytesWritten, q,
- &QWebSocket::bytesWritten);
- typedef void (QSslSocket:: *sslErrorSignalType)(const QList<QSslError> &);
- QObject::connect(sslSocket,
- static_cast<sslErrorSignalType>(&QSslSocket::sslErrors),
- q, &QWebSocket::sslErrors);
setSocketState(QAbstractSocket::ConnectingState);
sslSocket->setSslConfiguration(m_configuration.m_sslConfiguration);
@@ -418,8 +412,6 @@ void QWebSocketPrivate::open(const QUrl &url, bool mask)
m_pSocket->setPauseMode(m_pauseMode);
makeConnections(m_pSocket.data());
- QObject::connect(m_pSocket.data(), &QAbstractSocket::bytesWritten, q,
- &QWebSocket::bytesWritten);
setSocketState(QAbstractSocket::ConnectingState);
#ifndef QT_NO_NETWORKPROXY
m_pSocket->setProxy(m_configuration.m_proxy);
@@ -537,7 +529,7 @@ void QWebSocketPrivate::makeConnections(const QTcpSocket *pTcpSocket)
#ifndef QT_NO_NETWORKPROXY
QObject::connect(pTcpSocket, &QAbstractSocket::proxyAuthenticationRequired, q,
&QWebSocket::proxyAuthenticationRequired);
-#endif
+#endif // QT_NO_NETWORKPROXY
QObject::connect(pTcpSocket, &QAbstractSocket::readChannelFinished, q,
&QWebSocket::readChannelFinished);
QObject::connect(pTcpSocket, &QAbstractSocket::aboutToClose, q, &QWebSocket::aboutToClose);
@@ -550,6 +542,21 @@ void QWebSocketPrivate::makeConnections(const QTcpSocket *pTcpSocket)
//with QTcpSocket there is no problem, but with QSslSocket the processing hangs
QObjectPrivate::connect(pTcpSocket, &QAbstractSocket::readyRead, this,
&QWebSocketPrivate::processData, Qt::QueuedConnection);
+#ifndef QT_NO_SSL
+ const QSslSocket * const sslSocket = qobject_cast<const QSslSocket *>(pTcpSocket);
+ if (sslSocket) {
+ QObject::connect(sslSocket, &QSslSocket::encryptedBytesWritten, q,
+ &QWebSocket::bytesWritten);
+ typedef void (QSslSocket:: *sslErrorSignalType)(const QList<QSslError> &);
+ QObject::connect(sslSocket,
+ static_cast<sslErrorSignalType>(&QSslSocket::sslErrors),
+ q, &QWebSocket::sslErrors);
+ } else
+#endif // QT_NO_SSL
+ {
+ QObject::connect(pTcpSocket, &QAbstractSocket::bytesWritten, q,
+ &QWebSocket::bytesWritten);
+ }
}
QObject::connect(&m_dataProcessor, &QWebSocketDataProcessor::textFrameReceived, q,