Improve reliability of SSL connections
authorMichael Marley <michael@michaelmarley.com>
Wed, 11 Dec 2013 21:15:58 +0000 (21:15 +0000)
committerManuel Nickschas <sputnick@quassel-irc.org>
Mon, 13 Jan 2014 23:14:31 +0000 (00:14 +0100)
commit411cf6cc06dd7f1c393efb52ffa1d213c40393a1
treef7988e03f7e8c70f4838bf8663592a0a1098223a
parentac4ff7a1ffdc58f3e6efd37ba6e61ecaa6d51644
Improve reliability of SSL connections

First, this fixes a bug similar to Bug #1249 except for SSL
connections.  If the TCP connection fails but isn't
actually closed before the SSL handshake is complete,
Quassel will become stuck and never attempt to reconnect.
The solution is to start the ping timeout even earlier,
before the connection is established at all.

Second, this fixes the issue where multiple presses of the
"Disconnect" button and long waits were required to close
certain broken SSL connections (where SSL negotiation was
not yet complete, as above).  The solution is to call
socket.abort() instead of socket.disconnectFromHost(),
which will ensure that the socket is closed immediately.
Additionally, in case that fails for some reason, the
socketCloseTimer is no longer a single-shot timer, so
if the first abort doesn't work, it will keep trying.

(Probably?) fixes bug #1005
src/core/corenetwork.cpp
src/core/corenetwork.h