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:
parent
29af8741b6
commit
1b459a8124
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user