diff options
author | Markus Goetz <Markus.Goetz@nokia.com> | 2010-02-22 13:48:38 (GMT) |
---|---|---|
committer | Markus Goetz <Markus.Goetz@nokia.com> | 2010-02-22 14:52:39 (GMT) |
commit | 8aaa61f8ea11c6e5794b5a3f6bf14bbbcb712074 (patch) | |
tree | 1473bfc04dc3dc56c36edacf294edad2d994d89e /src/network | |
parent | dbdb4c507ac209adc4391c95d312be0ad01e77a9 (diff) | |
download | Qt-8aaa61f8ea11c6e5794b5a3f6bf14bbbcb712074.zip Qt-8aaa61f8ea11c6e5794b5a3f6bf14bbbcb712074.tar.gz Qt-8aaa61f8ea11c6e5794b5a3f6bf14bbbcb712074.tar.bz2 |
QNativeSocketEngine: Fix some error handling related to waitFor*()
Task: QTBUG-7054
Reviewed-by: Peter Hartmann
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/socket/qnativesocketengine.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/network/socket/qnativesocketengine.cpp b/src/network/socket/qnativesocketengine.cpp index a890b3b..a169ca0 100644 --- a/src/network/socket/qnativesocketengine.cpp +++ b/src/network/socket/qnativesocketengine.cpp @@ -185,6 +185,9 @@ void QNativeSocketEnginePrivate::setError(QAbstractSocket::SocketError error, Er // socket to recreate its engine after an error. Note: There's // one exception: SocketError(11) bypasses this as it's purely // a temporary internal error condition. + // Another exception is the way the waitFor*() functions set + // an error when a timeout occurs. After the call to setError() + // they reset the hasSetSocketError to false return; } if (error != QAbstractSocket::SocketError(11)) @@ -859,6 +862,7 @@ bool QNativeSocketEngine::waitForRead(int msecs, bool *timedOut) *timedOut = true; d->setError(QAbstractSocket::SocketTimeoutError, QNativeSocketEnginePrivate::TimeOutErrorString); + d->hasSetSocketError = false; // A timeout error is temporary in waitFor functions return false; } else if (state() == QAbstractSocket::ConnectingState) { connectToHost(d->peerAddress, d->peerPort); @@ -927,6 +931,7 @@ bool QNativeSocketEngine::waitForWrite(int msecs, bool *timedOut) *timedOut = true; d->setError(QAbstractSocket::SocketTimeoutError, QNativeSocketEnginePrivate::TimeOutErrorString); + d->hasSetSocketError = false; // A timeout error is temporary in waitFor functions return false; } else if (state() == QAbstractSocket::ConnectingState) { connectToHost(d->peerAddress, d->peerPort); @@ -978,6 +983,7 @@ bool QNativeSocketEngine::waitForReadOrWrite(bool *readyToRead, bool *readyToWri *timedOut = true; d->setError(QAbstractSocket::SocketTimeoutError, QNativeSocketEnginePrivate::TimeOutErrorString); + d->hasSetSocketError = false; // A timeout error is temporary in waitFor functions return false; } else if (state() == QAbstractSocket::ConnectingState) { connectToHost(d->peerAddress, d->peerPort); |