QAbstractSocket: Always set errorString right after socketError

Otherwise errorString() might not match error() in a
statusChanged handler.

Change-Id: If1250b4552412eabe88457dee031e4ef3f533838
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Kai Koehne 2015-07-10 15:03:43 +02:00
parent 29af8741b6
commit 1b459a8124

View File

@ -2086,10 +2086,10 @@ bool QAbstractSocket::waitForConnected(int msecs)
if ((timedOut && state() != ConnectedState) || state() == ConnectingState) {
d->socketError = SocketTimeoutError;
setErrorString(tr("Socket operation timed out"));
d->state = UnconnectedState;
emit stateChanged(d->state);
d->resetSocketLayer();
setErrorString(tr("Socket operation timed out"));
}
#if defined (QABSTRACTSOCKET_DEBUG)