summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-11-06 01:00:08 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2019-11-06 11:41:19 +0100
commite3cc16e9fba045b3d195bc0e35dff4735bb6f59c (patch)
treea048d9ecb07ae175b4b357216c7e3e74d41c1271 /src/network
parent2e63d121839dae2794685001563783eea4c997f0 (diff)
parent7f0aaa88ef1db3840bd504d63a38d53032b8f802 (diff)
Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts: .qmake.conf mkspecs/features/mac/default_post.prf src/corelib/tools/qsimd_p.h src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm util/qfloat16-tables/gen_qfloat16_tables.cpp Change-Id: If48fa8a3bc3c983706b609a6d3822cb67c1352a4
Diffstat (limited to 'src/network')
-rw-r--r--src/network/doc/snippets/code/src_network_socket_qabstractsocket.cpp5
-rw-r--r--src/network/doc/snippets/code/src_network_socket_qlocalsocket_unix.cpp4
-rw-r--r--src/network/socket/qabstractsocket.cpp11
-rw-r--r--src/network/socket/qlocalsocket.cpp11
-rw-r--r--src/network/ssl/qsslsocket_schannel.cpp3
5 files changed, 20 insertions, 14 deletions
diff --git a/src/network/doc/snippets/code/src_network_socket_qabstractsocket.cpp b/src/network/doc/snippets/code/src_network_socket_qabstractsocket.cpp
index 3db16b50e6..e19cb40666 100644
--- a/src/network/doc/snippets/code/src_network_socket_qabstractsocket.cpp
+++ b/src/network/doc/snippets/code/src_network_socket_qabstractsocket.cpp
@@ -57,9 +57,10 @@ if (socket->waitForConnected(1000))
//! [1]
socket->disconnectFromHost();
- if (socket->state() == QAbstractSocket::UnconnectedState ||
- socket->waitForDisconnected(1000))
+if (socket->state() == QAbstractSocket::UnconnectedState
+ || socket->waitForDisconnected(1000)) {
qDebug("Disconnected!");
+}
//! [1]
diff --git a/src/network/doc/snippets/code/src_network_socket_qlocalsocket_unix.cpp b/src/network/doc/snippets/code/src_network_socket_qlocalsocket_unix.cpp
index 181f9c1686..deafca831d 100644
--- a/src/network/doc/snippets/code/src_network_socket_qlocalsocket_unix.cpp
+++ b/src/network/doc/snippets/code/src_network_socket_qlocalsocket_unix.cpp
@@ -57,6 +57,8 @@ if (socket->waitForConnected(1000))
//! [1]
socket->disconnectFromServer();
-if (socket->waitForDisconnected(1000))
+if (socket->state() == QLocalSocket::UnconnectedState
+ || socket->waitForDisconnected(1000)) {
qDebug("Disconnected!");
+}
//! [1]
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp
index 9c8f29e18a..b1ea9a4133 100644
--- a/src/network/socket/qabstractsocket.cpp
+++ b/src/network/socket/qabstractsocket.cpp
@@ -2359,11 +2359,12 @@ bool QAbstractSocket::waitForBytesWritten(int msecs)
}
/*!
- Waits until the socket has disconnected, up to \a msecs
- milliseconds. If the connection has been disconnected, 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.
+ Waits until the socket has disconnected, up to \a msecs milliseconds. If the
+ 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 QAbstractSocket is already disconnected). In the case
+ where it returns \c false, you can call error() to determine the cause of
+ the error.
The following example waits up to one second for a connection
to be closed:
diff --git a/src/network/socket/qlocalsocket.cpp b/src/network/socket/qlocalsocket.cpp
index 1c34cd13ee..af7cdb76d2 100644
--- a/src/network/socket/qlocalsocket.cpp
+++ b/src/network/socket/qlocalsocket.cpp
@@ -287,11 +287,12 @@ QT_BEGIN_NAMESPACE
/*!
\fn bool QLocalSocket::waitForDisconnected(int msecs)
- Waits until the socket has disconnected, up to \a msecs
- milliseconds. If the connection has been disconnected, 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.
+ Waits until the socket has disconnected, up to \a msecs milliseconds. If the
+ 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
+ the error.
The following example waits up to one second for a connection
to be closed:
diff --git a/src/network/ssl/qsslsocket_schannel.cpp b/src/network/ssl/qsslsocket_schannel.cpp
index d7fb080b49..c6e3e4d786 100644
--- a/src/network/ssl/qsslsocket_schannel.cpp
+++ b/src/network/ssl/qsslsocket_schannel.cpp
@@ -974,6 +974,7 @@ bool QSslSocketBackendPrivate::performHandshake()
bool QSslSocketBackendPrivate::verifyHandshake()
{
Q_Q(QSslSocket);
+ sslErrors.clear();
const bool isClient = mode == QSslSocket::SslClientMode;
#define CHECK_STATUS(status) \
@@ -1062,7 +1063,7 @@ bool QSslSocketBackendPrivate::verifyHandshake()
}
// verifyCertContext returns false if the user disconnected while it was checking errors.
- if (certificateContext && sslErrors.isEmpty() && !verifyCertContext(certificateContext))
+ if (certificateContext && !verifyCertContext(certificateContext))
return false;
if (!checkSslErrors() || state != QAbstractSocket::ConnectedState) {