diff options
author | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2012-10-16 18:25:01 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-25 14:10:04 +0200 |
commit | ed19c0875e9a2485dcd2cbab3f603611ad0b19c9 (patch) | |
tree | 31a098538d5427194c295ca6132c37b7d61993c8 /src/network/ssl/qsslsocket.cpp | |
parent | a26c97859a2d67392af4e1748b14623072ebe555 (diff) |
QSslSocket: Allow disconnections within the connected() signal
When doing happy eyeballs style network state lookup, we might have to
close an SSL socket from its connected signal. This can cause the warning:
QSslSocket::startClientEncryption: cannot start handshake when not connected
The signal should be emitted after we called startClientEncryption to
avoid this warning. In that case it will initialize the encryption
and ramp it down right after.
Change-Id: I0c8c79cad7f91f0088b87c5e4ee8aafbc688411c
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Diffstat (limited to 'src/network/ssl/qsslsocket.cpp')
-rw-r--r-- | src/network/ssl/qsslsocket.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp index 8260c1c563..e97cf0817a 100644 --- a/src/network/ssl/qsslsocket.cpp +++ b/src/network/ssl/qsslsocket.cpp @@ -2153,11 +2153,13 @@ void QSslSocketPrivate::_q_connectedSlot() qDebug() << "\tlocal =" << QHostInfo::fromName(q->localAddress().toString()).hostName() << q->localAddress() << q->localPort(); #endif - emit q->connected(); - if (autoStartHandshake) { + if (autoStartHandshake) q->startClientEncryption(); - } else if (pendingClose) { + + emit q->connected(); + + if (pendingClose && !autoStartHandshake) { pendingClose = false; q->disconnectFromHost(); } |