Fix potential state desync in disconnectFromIrc() 104/head
authorMichael Marley <michael@michaelmarley.com>
Sat, 20 Dec 2014 20:22:19 +0000 (15:22 -0500)
committerMichael Marley <michael@michaelmarley.com>
Sat, 20 Dec 2014 20:22:19 +0000 (15:22 -0500)
commit51b46e3bdedd82eed34844c372efe432ec51d95d
tree90ead909efb1ca3559a00dd6c5cba6d927b1617c
parent9c5fd60f6264898a7c0287e3f7d47e181ef39f84
Fix potential state desync in disconnectFromIrc()

Previously, disconnectFromIrc() would assume that if the socket was
in any state other than ConnectedState that it was disconnected and
send the socketDisconnected() signal.  However, if the socket was
in a different state, such as ConnectingState, this caused the
corenetwork state and the socket state to become desynchronized.
This patch causes disconnectFromIrc() to close the socket and
start the socketCloseTimer in the event that the socket is in a
state other than UnconnectedState or ConnectedState.
src/core/corenetwork.cpp