diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2016-03-22 07:24:57 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2016-03-22 07:28:42 +0100 |
commit | a02863234d76abb6c9f289026ae4ea3145924f30 (patch) | |
tree | aef6381d0000a78ba69ac80eb03739b1c8ca5fc3 /src/network/ssl/qsslsocket.cpp | |
parent | e77b13621f0057374d83a2b884f03dd2e5b7b88c (diff) | |
parent | e4d79e1fdeb6b26ba0b12b578daacf7cd672b960 (diff) |
Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
configure
mkspecs/common/wince/qplatformdefs.h
src/plugins/platforms/directfb/qdirectfbbackingstore.cpp
src/plugins/platforms/xcb/qxcbbackingstore.cpp
Change-Id: Ied4d31264a9afca9514b51a7eb1494c28712793c
Diffstat (limited to 'src/network/ssl/qsslsocket.cpp')
-rw-r--r-- | src/network/ssl/qsslsocket.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp index f1fbc30424..bbc62c47ff 100644 --- a/src/network/ssl/qsslsocket.cpp +++ b/src/network/ssl/qsslsocket.cpp @@ -512,6 +512,8 @@ bool QSslSocket::setSocketDescriptor(qintptr socketDescriptor, SocketState state setPeerPort(d->plainSocket->peerPort()); setPeerAddress(d->plainSocket->peerAddress()); setPeerName(d->plainSocket->peerName()); + d->readChannelCount = d->plainSocket->readChannelCount(); + d->writeChannelCount = d->plainSocket->writeChannelCount(); return retVal; } @@ -1917,6 +1919,7 @@ void QSslSocket::connectToHost(const QString &hostName, quint16 port, OpenMode o d->plainSocket->setProxy(proxy()); #endif QIODevice::open(openMode); + d->readChannelCount = d->writeChannelCount = 0; d->plainSocket->connectToHost(hostName, port, openMode, d->preferredNetworkLayerProtocol); d->cachedSocketDescriptor = d->plainSocket->socketDescriptor(); } @@ -2263,9 +2266,15 @@ void QSslSocketPrivate::createPlainSocket(QIODevice::OpenMode openMode) q->connect(plainSocket, SIGNAL(readyRead()), q, SLOT(_q_readyReadSlot()), Qt::DirectConnection); + q->connect(plainSocket, SIGNAL(channelReadyRead(int)), + q, SLOT(_q_channelReadyReadSlot(int)), + Qt::DirectConnection); q->connect(plainSocket, SIGNAL(bytesWritten(qint64)), q, SLOT(_q_bytesWrittenSlot(qint64)), Qt::DirectConnection); + q->connect(plainSocket, SIGNAL(channelBytesWritten(int, qint64)), + q, SLOT(_q_channelBytesWrittenSlot(int, qint64)), + Qt::DirectConnection); #ifndef QT_NO_NETWORKPROXY q->connect(plainSocket, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)), q, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*))); @@ -2319,6 +2328,7 @@ bool QSslSocketPrivate::bind(const QHostAddress &address, quint16 port, QAbstrac localPort = plainSocket->localPort(); localAddress = plainSocket->localAddress(); cachedSocketDescriptor = plainSocket->socketDescriptor(); + readChannelCount = writeChannelCount = 0; return ret; } @@ -2334,6 +2344,8 @@ void QSslSocketPrivate::_q_connectedSlot() q->setPeerAddress(plainSocket->peerAddress()); q->setPeerName(plainSocket->peerName()); cachedSocketDescriptor = plainSocket->socketDescriptor(); + readChannelCount = plainSocket->readChannelCount(); + writeChannelCount = plainSocket->writeChannelCount(); #ifdef QSSLSOCKET_DEBUG qCDebug(lcSsl) << "QSslSocket::_q_connectedSlot()"; @@ -2439,6 +2451,16 @@ void QSslSocketPrivate::_q_readyReadSlot() /*! \internal */ +void QSslSocketPrivate::_q_channelReadyReadSlot(int channel) +{ + Q_Q(QSslSocket); + if (mode == QSslSocket::UnencryptedMode) + emit q->channelReadyRead(channel); +} + +/*! + \internal +*/ void QSslSocketPrivate::_q_bytesWrittenSlot(qint64 written) { Q_Q(QSslSocket); @@ -2457,6 +2479,16 @@ void QSslSocketPrivate::_q_bytesWrittenSlot(qint64 written) /*! \internal */ +void QSslSocketPrivate::_q_channelBytesWrittenSlot(int channel, qint64 written) +{ + Q_Q(QSslSocket); + if (mode == QSslSocket::UnencryptedMode) + emit q->channelBytesWritten(channel, written); +} + +/*! + \internal +*/ void QSslSocketPrivate::_q_flushWriteBuffer() { Q_Q(QSslSocket); |