Set pendingClose to false on init in QSslSocket
authorMichael Marley <michael@michaelmarley.com>
Tue, 13 Jan 2015 02:59:43 +0000 (21:59 -0500)
committerJani Heikkinen <jani.heikkinen@theqtcompany.com>
Mon, 19 Jan 2015 07:16:24 +0000 (08:16 +0100)
Fixes an issue where under certain circumstances, QSslSocket could get
stuck in a state where it would disconnect immediately after starting
encryption.  Since it doesn't make any sense for the socket to be
initialized to a state where any connection attempt will fail, the
pendingClose value should be set to false.

Thanks to Martin Sandsmark for his help debugging this issue.

Task-number: QTBUG-43793
Change-Id: I7deebacbac588c21439a8e594db4222095cf3f22
Reviewed-by: Richard J. Moore <rich@kde.org>
src/network/ssl/qsslsocket.cpp

index 31c7b3087ea831b8a0e5b199ee328c28c84ca300..0f7c376e04600af582178fcb7769dcfdf2ff7538 100644 (file)
@@ -1982,6 +1982,7 @@ void QSslSocketPrivate::init()
     connectionEncrypted = false;
     ignoreAllSslErrors = false;
     shutdown = false;
+    pendingClose = false;
 
     // we don't want to clear the ignoreErrorsList, so
     // that it is possible setting it before connecting