diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2020-01-13 01:01:03 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2020-01-13 10:13:01 +0100 |
commit | cccc9d0b95cd021ae93c70867771a57aaadd16ff (patch) | |
tree | 34948260f68ee30b3ee0f8656d9b518e1438b606 /src/network | |
parent | 0dc5562fa4f01140e98e55ceaa743b0f4fc276c7 (diff) | |
parent | 76c4c5d5581b2cd36a043234eb167dd55041301d (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
Change-Id: I4d3041fa291a918c774ffa5eb5c8792a0966451d
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/access/qhttpprotocolhandler.cpp | 2 | ||||
-rw-r--r-- | src/network/access/qnetworkaccessdebugpipebackend.cpp | 4 | ||||
-rw-r--r-- | src/network/socket/qabstractsocket.cpp | 29 | ||||
-rw-r--r-- | src/network/socket/qabstractsocket.h | 7 | ||||
-rw-r--r-- | src/network/socket/qhttpsocketengine.cpp | 13 | ||||
-rw-r--r-- | src/network/socket/qlocalsocket.cpp | 24 | ||||
-rw-r--r-- | src/network/socket/qlocalsocket.h | 7 | ||||
-rw-r--r-- | src/network/socket/qlocalsocket_tcp.cpp | 7 | ||||
-rw-r--r-- | src/network/socket/qlocalsocket_unix.cpp | 9 | ||||
-rw-r--r-- | src/network/socket/qlocalsocket_win.cpp | 7 | ||||
-rw-r--r-- | src/network/socket/qsocks5socketengine.cpp | 22 | ||||
-rw-r--r-- | src/network/ssl/qdtls_openssl.cpp | 2 | ||||
-rw-r--r-- | src/network/ssl/qsslsocket.cpp | 35 | ||||
-rw-r--r-- | src/network/ssl/qsslsocket.h | 5 | ||||
-rw-r--r-- | src/network/ssl/qsslsocket_openssl.cpp | 2 | ||||
-rw-r--r-- | src/network/ssl/qsslsocket_schannel.cpp | 4 |
16 files changed, 133 insertions, 46 deletions
diff --git a/src/network/access/qhttpprotocolhandler.cpp b/src/network/access/qhttpprotocolhandler.cpp index d39589fb96..981effb54f 100644 --- a/src/network/access/qhttpprotocolhandler.cpp +++ b/src/network/access/qhttpprotocolhandler.cpp @@ -233,7 +233,7 @@ void QHttpProtocolHandler::_q_readyRead() char c; qint64 ret = m_socket->peek(&c, 1); if (ret < 0) { - m_channel->_q_error(m_socket->error()); + m_channel->_q_error(m_socket->socketError()); // We still need to handle the reply so it emits its signals etc. if (m_reply) _q_receiveReply(); diff --git a/src/network/access/qnetworkaccessdebugpipebackend.cpp b/src/network/access/qnetworkaccessdebugpipebackend.cpp index 03ffc69628..0406f2fac1 100644 --- a/src/network/access/qnetworkaccessdebugpipebackend.cpp +++ b/src/network/access/qnetworkaccessdebugpipebackend.cpp @@ -242,9 +242,9 @@ void QNetworkAccessDebugPipeBackend::closeDownstreamChannel() void QNetworkAccessDebugPipeBackend::socketError() { - qWarning("QNetworkAccessDebugPipeBackend::socketError() %d",socket.error()); + qWarning("QNetworkAccessDebugPipeBackend::socketError() %d",socket.socketError()); QNetworkReply::NetworkError code; - switch (socket.error()) { + switch (socket.socketError()) { case QAbstractSocket::RemoteHostClosedError: return; // socketDisconnected will be called diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index cbc4114904..0d9e25954d 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -215,7 +215,7 @@ connections, you will have to register it with Q_DECLARE_METATYPE() and qRegisterMetaType(). - \sa error(), errorString(), {Creating Custom Qt Types} + \sa socketError(), errorString(), {Creating Custom Qt Types} */ /*! @@ -329,7 +329,7 @@ is non-blocking). \value UnknownSocketError An unidentified error occurred. - \sa QAbstractSocket::error() + \sa QAbstractSocket::socketError() */ /*! @@ -2094,7 +2094,7 @@ QVariant QAbstractSocket::socketOption(QAbstractSocket::SocketOption option) Waits until the socket is connected, up to \a msecs milliseconds. If the connection has been established, this function returns \c true; otherwise it returns \c false. In the case - where it returns \c false, you can call error() to determine + where it returns \c false, you can call socketError() to determine the cause of the error. The following example waits up to one second for a connection @@ -2873,7 +2873,7 @@ void QAbstractSocket::setReadBufferSize(qint64 size) /*! Returns the state of the socket. - \sa error() + \sa socketError() */ QAbstractSocket::SocketState QAbstractSocket::state() const { @@ -2900,16 +2900,35 @@ QAbstractSocket::SocketType QAbstractSocket::socketType() const return d_func()->socketType; } +#if QT_DEPRECATED_SINCE(5, 15) /*! + \deprecated + + Use socketError() instead. + Returns the type of error that last occurred. - \sa state(), errorString() + \sa state(), errorString(), socketError() */ QAbstractSocket::SocketError QAbstractSocket::error() const { + return socketError(); +} +#endif // QT_DEPRECATED_SINCE(5, 15) + +/*! + \since 5.15 + + Returns the type of error that last occurred. + + \sa state(), errorString() +*/ +QAbstractSocket::SocketError QAbstractSocket::socketError() const +{ return d_func()->socketError; } + /*! Sets the type of error that last occurred to \a socketError. diff --git a/src/network/socket/qabstractsocket.h b/src/network/socket/qabstractsocket.h index de09195eeb..cbc79ea684 100644 --- a/src/network/socket/qabstractsocket.h +++ b/src/network/socket/qabstractsocket.h @@ -180,7 +180,12 @@ public: SocketType socketType() const; SocketState state() const; - SocketError error() const; + +#if QT_DEPRECATED_SINCE(5, 15) + QT_DEPRECATED_X("Use socketError()") SocketError error() const; +#endif // QT_DEPRECATED_SINCE(5, 15) + + SocketError socketError() const; // from QIODevice void close() override; diff --git a/src/network/socket/qhttpsocketengine.cpp b/src/network/socket/qhttpsocketengine.cpp index 76b3053224..9a26868edc 100644 --- a/src/network/socket/qhttpsocketengine.cpp +++ b/src/network/socket/qhttpsocketengine.cpp @@ -370,8 +370,8 @@ bool QHttpSocketEngine::waitForRead(int msecs, bool *timedOut) if (!d->socket->waitForReadyRead(qt_subtract_from_timeout(msecs, stopWatch.elapsed()))) { if (d->socket->state() == QAbstractSocket::UnconnectedState) return true; - setError(d->socket->error(), d->socket->errorString()); - if (timedOut && d->socket->error() == QAbstractSocket::SocketTimeoutError) + setError(d->socket->socketError(), d->socket->errorString()); + if (timedOut && d->socket->socketError() == QAbstractSocket::SocketTimeoutError) *timedOut = true; return false; } @@ -385,8 +385,8 @@ bool QHttpSocketEngine::waitForRead(int msecs, bool *timedOut) // Report any error that may occur. if (d->state != Connected) { - setError(d->socket->error(), d->socket->errorString()); - if (timedOut && d->socket->error() == QAbstractSocket::SocketTimeoutError) + setError(d->socket->socketError(), d->socket->errorString()); + if (timedOut && d->socket->socketError() == QAbstractSocket::SocketTimeoutError) *timedOut = true; return false; } @@ -401,7 +401,7 @@ bool QHttpSocketEngine::waitForWrite(int msecs, bool *timedOut) if (d->state == Connected) { if (d->socket->bytesToWrite()) { if (!d->socket->waitForBytesWritten(msecs)) { - if (d->socket->error() == QAbstractSocket::SocketTimeoutError && timedOut) + if (d->socket->socketError() == QAbstractSocket::SocketTimeoutError && timedOut) *timedOut = true; return false; } @@ -421,8 +421,7 @@ bool QHttpSocketEngine::waitForWrite(int msecs, bool *timedOut) // Report any error that may occur. if (d->state != Connected) { -// setError(d->socket->error(), d->socket->errorString()); - if (timedOut && d->socket->error() == QAbstractSocket::SocketTimeoutError) + if (timedOut && d->socket->socketError() == QAbstractSocket::SocketTimeoutError) *timedOut = true; } diff --git a/src/network/socket/qlocalsocket.cpp b/src/network/socket/qlocalsocket.cpp index d35f838af5..d517f91aad 100644 --- a/src/network/socket/qlocalsocket.cpp +++ b/src/network/socket/qlocalsocket.cpp @@ -220,11 +220,25 @@ QT_BEGIN_NAMESPACE /*! \fn QLocalSocket::LocalSocketError QLocalSocket::error() const + \deprecated + + Use socketError() instead. + + Returns the type of error that last occurred. + + \sa state(), errorString(), socketError() +*/ + +/*! + \fn QLocalSocket::LocalSocketError QLocalSocket::socketError() const + \since 5.15 + Returns the type of error that last occurred. \sa state(), errorString() */ + /*! \fn bool QLocalSocket::isValid() const @@ -272,7 +286,7 @@ QT_BEGIN_NAMESPACE Waits until the socket is connected, up to \a msecs milliseconds. If the connection has been established, this function returns \c true; otherwise it returns \c false. In the case where it returns \c false, you can call - error() to determine the cause of the error. + socketError() to determine the cause of the error. The following example waits up to one second for a connection to be established: @@ -291,7 +305,7 @@ QT_BEGIN_NAMESPACE connection was successfully disconnected, this function returns \c true; otherwise it returns \c false (if the operation timed out, if an error occurred, or if this QLocalSocket is already disconnected). In the case - where it returns \c false, you can call error() to determine the cause of + where it returns \c false, you can call socketError() to determine the cause of the error. The following example waits up to one second for a connection @@ -337,7 +351,7 @@ QT_BEGIN_NAMESPACE connections, you will have to register it with Q_DECLARE_METATYPE() and qRegisterMetaType(). - \sa error(), errorString(), {Creating Custom Qt Types} + \sa socketError(), errorString(), {Creating Custom Qt Types} */ /*! @@ -446,7 +460,7 @@ QString QLocalSocket::fullServerName() const /*! Returns the state of the socket. - \sa error() + \sa socketError() */ QLocalSocket::LocalSocketState QLocalSocket::state() const { @@ -466,7 +480,7 @@ bool QLocalSocket::isSequential() const The LocalServerError enumeration represents the errors that can occur. The most recent error can be retrieved through a call to - \l QLocalSocket::error(). + \l QLocalSocket::socketError(). \value ConnectionRefusedError The connection was refused by the peer (or timed out). diff --git a/src/network/socket/qlocalsocket.h b/src/network/socket/qlocalsocket.h index 1876a6ac0d..9cf76d1022 100644 --- a/src/network/socket/qlocalsocket.h +++ b/src/network/socket/qlocalsocket.h @@ -97,7 +97,12 @@ public: virtual bool canReadLine() const override; virtual bool open(OpenMode openMode = ReadWrite) override; virtual void close() override; - LocalSocketError error() const; + +#if QT_DEPRECATED_SINCE(5, 15) + QT_DEPRECATED_X("Use socketError()") LocalSocketError error() const; +#endif // QT_DEPRECATED_SINCE(5, 15) + + LocalSocketError socketError() const; bool flush(); bool isValid() const; qint64 readBufferSize() const; diff --git a/src/network/socket/qlocalsocket_tcp.cpp b/src/network/socket/qlocalsocket_tcp.cpp index 41e5b47627..74d3d547b9 100644 --- a/src/network/socket/qlocalsocket_tcp.cpp +++ b/src/network/socket/qlocalsocket_tcp.cpp @@ -363,8 +363,15 @@ void QLocalSocket::disconnectFromServer() d->tcpSocket->disconnectFromHost(); } +#if QT_DEPRECATED_SINCE(5, 15) QLocalSocket::LocalSocketError QLocalSocket::error() const { + return socketError(); +} +#endif // QT_DEPRECATED_SINCE(5, 15) + +QLocalSocket::LocalSocketError QLocalSocket::socketError() const +{ Q_D(const QLocalSocket); switch (d->tcpSocket->error()) { case QAbstractSocket::ConnectionRefusedError: diff --git a/src/network/socket/qlocalsocket_unix.cpp b/src/network/socket/qlocalsocket_unix.cpp index 7de9a7d4c7..2e2eb7dee9 100644 --- a/src/network/socket/qlocalsocket_unix.cpp +++ b/src/network/socket/qlocalsocket_unix.cpp @@ -461,10 +461,17 @@ void QLocalSocket::disconnectFromServer() d->unixSocket.disconnectFromHost(); } +#if QT_DEPRECATED_SINCE(5, 15) QLocalSocket::LocalSocketError QLocalSocket::error() const { + return socketError(); +} +#endif // QT_DEPRECATED_SINCE(5, 15) + +QLocalSocket::LocalSocketError QLocalSocket::socketError() const +{ Q_D(const QLocalSocket); - switch (d->unixSocket.error()) { + switch (d->unixSocket.socketError()) { case QAbstractSocket::ConnectionRefusedError: return QLocalSocket::ConnectionRefusedError; case QAbstractSocket::RemoteHostClosedError: diff --git a/src/network/socket/qlocalsocket_win.cpp b/src/network/socket/qlocalsocket_win.cpp index 4decbd5ded..657790519b 100644 --- a/src/network/socket/qlocalsocket_win.cpp +++ b/src/network/socket/qlocalsocket_win.cpp @@ -330,8 +330,15 @@ void QLocalSocket::disconnectFromServer() } } +#if QT_DEPRECATED_SINCE(5, 15) QLocalSocket::LocalSocketError QLocalSocket::error() const { + return socketError(); +} +#endif // QT_DEPRECATED_SINCE(5, 15) + +QLocalSocket::LocalSocketError QLocalSocket::socketError() const +{ Q_D(const QLocalSocket); return d->error; } diff --git a/src/network/socket/qsocks5socketengine.cpp b/src/network/socket/qsocks5socketengine.cpp index 622d5df131..3bce891ee9 100644 --- a/src/network/socket/qsocks5socketengine.cpp +++ b/src/network/socket/qsocks5socketengine.cpp @@ -594,7 +594,7 @@ void QSocks5SocketEnginePrivate::setErrorState(Socks5State state, const QString case ConnectError: case ControlSocketError: { - QAbstractSocket::SocketError controlSocketError = data->controlSocket->error(); + QAbstractSocket::SocketError controlSocketError = data->controlSocket->socketError(); if (socks5State != Connected) { switch (controlSocketError) { case QAbstractSocket::ConnectionRefusedError: @@ -918,7 +918,7 @@ void QSocks5SocketEnginePrivate::_q_emitPendingReadNotification() return; // check if there needs to be a new zero read notification if (data && data->controlSocket->state() == QAbstractSocket::UnconnectedState - && data->controlSocket->error() == QAbstractSocket::RemoteHostClosedError) { + && data->controlSocket->socketError() == QAbstractSocket::RemoteHostClosedError) { connectData->readBuffer.clear(); emitReadNotification(); } @@ -1256,7 +1256,7 @@ void QSocks5SocketEnginePrivate::_q_controlSocketError(QAbstractSocket::SocketEr data->controlSocket->close(); emitConnectionNotification(); } else { - q_func()->setError(data->controlSocket->error(), data->controlSocket->errorString()); + q_func()->setError(data->controlSocket->socketError(), data->controlSocket->errorString()); emitReadNotification(); emitWriteNotification(); } @@ -1348,7 +1348,7 @@ bool QSocks5SocketEngine::bind(const QHostAddress &addr, quint16 port) if (d->mode == QSocks5SocketEnginePrivate::UdpAssociateMode) { if (!d->udpData->udpSocket->bind(address, port)) { QSOCKS5_Q_DEBUG << "local udp bind failed"; - setError(d->udpData->udpSocket->error(), d->udpData->udpSocket->errorString()); + setError(d->udpData->udpSocket->socketError(), d->udpData->udpSocket->errorString()); return false; } d->localAddress = d->udpData->udpSocket->localAddress(); @@ -1656,8 +1656,8 @@ qint64 QSocks5SocketEngine::writeDatagram(const char *data, qint64 len, const QI } if (d->udpData->udpSocket->writeDatagram(sealedBuf, d->udpData->associateAddress, d->udpData->associatePort) != sealedBuf.size()) { //### try frgamenting - if (d->udpData->udpSocket->error() == QAbstractSocket::DatagramTooLargeError) - setError(d->udpData->udpSocket->error(), d->udpData->udpSocket->errorString()); + if (d->udpData->udpSocket->socketError() == QAbstractSocket::DatagramTooLargeError) + setError(d->udpData->udpSocket->socketError(), d->udpData->udpSocket->errorString()); //### else maybe more serious error return -1; } @@ -1727,7 +1727,7 @@ bool QSocks5SocketEnginePrivate::waitForConnected(int msecs, bool *timedOut) return true; setErrorState(QSocks5SocketEnginePrivate::ControlSocketError); - if (timedOut && data->controlSocket->error() == QAbstractSocket::SocketTimeoutError) + if (timedOut && data->controlSocket->socketError() == QAbstractSocket::SocketTimeoutError) *timedOut = true; return false; } @@ -1765,8 +1765,8 @@ bool QSocks5SocketEngine::waitForRead(int msecs, bool *timedOut) if (d->data->controlSocket->state() == QAbstractSocket::UnconnectedState) return true; - setError(d->data->controlSocket->error(), d->data->controlSocket->errorString()); - if (timedOut && d->data->controlSocket->error() == QAbstractSocket::SocketTimeoutError) + setError(d->data->controlSocket->socketError(), d->data->controlSocket->errorString()); + if (timedOut && d->data->controlSocket->socketError() == QAbstractSocket::SocketTimeoutError) *timedOut = true; return false; } @@ -1775,8 +1775,8 @@ bool QSocks5SocketEngine::waitForRead(int msecs, bool *timedOut) } else { while (!d->readNotificationActivated) { if (!d->udpData->udpSocket->waitForReadyRead(qt_subtract_from_timeout(msecs, stopWatch.elapsed()))) { - setError(d->udpData->udpSocket->error(), d->udpData->udpSocket->errorString()); - if (timedOut && d->udpData->udpSocket->error() == QAbstractSocket::SocketTimeoutError) + setError(d->udpData->udpSocket->socketError(), d->udpData->udpSocket->errorString()); + if (timedOut && d->udpData->udpSocket->socketError() == QAbstractSocket::SocketTimeoutError) *timedOut = true; return false; } diff --git a/src/network/ssl/qdtls_openssl.cpp b/src/network/ssl/qdtls_openssl.cpp index 25a6c5f49c..36b4d572fd 100644 --- a/src/network/ssl/qdtls_openssl.cpp +++ b/src/network/ssl/qdtls_openssl.cpp @@ -1125,7 +1125,7 @@ qint64 QDtlsPrivateOpenSSL::writeDatagramEncrypted(QUdpSocket *socket, // some errors can be just ignored (it's UDP, not TCP after all). // Unlike QSslSocket we do not abort though. QString description(QSslSocketBackendPrivate::getErrorsFromOpenSsl()); - if (socket->error() != QAbstractSocket::UnknownSocketError && description.isEmpty()) { + if (socket->socketError() != QAbstractSocket::UnknownSocketError && description.isEmpty()) { setDtlsError(QDtlsError::UnderlyingSocketError, socket->errorString()); } else { setDtlsError(QDtlsError::TlsFatalError, diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp index b0fb32bbaf..504e27a463 100644 --- a/src/network/ssl/qsslsocket.cpp +++ b/src/network/ssl/qsslsocket.cpp @@ -357,7 +357,7 @@ If you want to continue connecting despite the errors that have occurred, you must call QSslSocket::ignoreSslErrors() from inside a slot connected to this signal. If you need to access the error list at a later point, you - can call sslErrors() (without arguments). + can call sslHandshakeErrors(). \a errors contains one or more errors that prevent QSslSocket from verifying the identity of the peer. @@ -659,7 +659,7 @@ bool QSslSocket::setSocketDescriptor(qintptr socketDescriptor, SocketState state d->createPlainSocket(openMode); bool retVal = d->plainSocket->setSocketDescriptor(socketDescriptor, state, openMode); d->cachedSocketDescriptor = d->plainSocket->socketDescriptor(); - d->setError(d->plainSocket->error(), d->plainSocket->errorString()); + d->setError(d->plainSocket->socketError(), d->plainSocket->errorString()); setSocketState(state); setOpenMode(openMode); setLocalPort(d->plainSocket->localPort()); @@ -1764,7 +1764,7 @@ bool QSslSocket::waitForConnected(int msecs) bool retVal = d->plainSocket->waitForConnected(msecs); if (!retVal) { setSocketState(d->plainSocket->state()); - d->setError(d->plainSocket->error(), d->plainSocket->errorString()); + d->setError(d->plainSocket->socketError(), d->plainSocket->errorString()); } return retVal; } @@ -1933,21 +1933,42 @@ bool QSslSocket::waitForDisconnected(int msecs) bool retVal = d->plainSocket->waitForDisconnected(qt_subtract_from_timeout(msecs, stopWatch.elapsed())); if (!retVal) { setSocketState(d->plainSocket->state()); - d->setError(d->plainSocket->error(), d->plainSocket->errorString()); + d->setError(d->plainSocket->socketError(), d->plainSocket->errorString()); } return retVal; } +#if QT_DEPRECATED_SINCE(5, 15) /*! + \deprecated + + Use sslHandshakeErrors() instead. + Returns a list of the last SSL errors that occurred. This is the same list as QSslSocket passes via the sslErrors() signal. If the connection has been encrypted with no errors, this function will return an empty list. - \sa connectToHostEncrypted() + \sa connectToHostEncrypted(), sslHandshakeErrors() */ QList<QSslError> QSslSocket::sslErrors() const { + return sslHandshakeErrors(); +} +#endif // QT_DEPRECATED_SINCE(5, 15) + +/*! + \since 5.15 + + Returns a list of the last SSL errors that occurred. This is the + same list as QSslSocket passes via the sslErrors() signal. If the + connection has been encrypted with no errors, this function will + return an empty list. + + \sa connectToHostEncrypted() +*/ +QList<QSslError> QSslSocket::sslHandshakeErrors() const +{ Q_D(const QSslSocket); return d->sslErrors; } @@ -2148,7 +2169,7 @@ void QSslSocket::ignoreSslErrors() You can clear the list of errors you want to ignore by calling this function with an empty list. - \sa sslErrors() + \sa sslErrors(), sslHandshakeErrors() */ void QSslSocket::ignoreSslErrors(const QList<QSslError> &errors) { @@ -2813,7 +2834,7 @@ void QSslSocketPrivate::_q_errorSlot(QAbstractSocket::SocketError error) readBufferMaxSize = tmpReadBufferMaxSize; } - setErrorAndEmit(plainSocket->error(), plainSocket->errorString()); + setErrorAndEmit(plainSocket->socketError(), plainSocket->errorString()); } /*! diff --git a/src/network/ssl/qsslsocket.h b/src/network/ssl/qsslsocket.h index 8b0f317da4..c12bb53334 100644 --- a/src/network/ssl/qsslsocket.h +++ b/src/network/ssl/qsslsocket.h @@ -235,7 +235,10 @@ public: bool waitForBytesWritten(int msecs = 30000) override; bool waitForDisconnected(int msecs = 30000) override; - QList<QSslError> sslErrors() const; +#if QT_DEPRECATED_SINCE(5, 15) + QT_DEPRECATED_X("Use sslHandshakeErrors()") QList<QSslError> sslErrors() const; +#endif // QT_DEPRECATED_SINCE(5, 15) + QList<QSslError> sslHandshakeErrors() const; static bool supportsSsl(); static long sslLibraryVersionNumber(); diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index f0775ba33b..11989cd2ef 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -1109,7 +1109,7 @@ void QSslSocketBackendPrivate::transmit() if (actualWritten < 0) { //plain socket write fails if it was in the pending close state. const ScopedBool bg(inSetAndEmitError, true); - setErrorAndEmit(plainSocket->error(), plainSocket->errorString()); + setErrorAndEmit(plainSocket->socketError(), plainSocket->errorString()); return; } transmitting = true; diff --git a/src/network/ssl/qsslsocket_schannel.cpp b/src/network/ssl/qsslsocket_schannel.cpp index 2db5c48ff2..ba15a0a65e 100644 --- a/src/network/ssl/qsslsocket_schannel.cpp +++ b/src/network/ssl/qsslsocket_schannel.cpp @@ -576,7 +576,7 @@ bool QSslSocketBackendPrivate::sendToken(void *token, unsigned long tokenLength, if (written != qint64(tokenLength)) { // Failed to write/buffer everything or an error occurred if (emitError) - setErrorAndEmit(plainSocket->error(), plainSocket->errorString()); + setErrorAndEmit(plainSocket->socketError(), plainSocket->errorString()); return false; } return true; @@ -1286,7 +1286,7 @@ void QSslSocketBackendPrivate::transmit() if (bytesWritten >= 0) { totalBytesWritten += bytesWritten; } else { - setErrorAndEmit(plainSocket->error(), plainSocket->errorString()); + setErrorAndEmit(plainSocket->socketError(), plainSocket->errorString()); return; } } |