summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2011-02-28 19:32:55 (GMT)
committerShane Kearns <shane.kearns@accenture.com>2011-03-08 18:48:41 (GMT)
commit5a488f8022626e71681ae42662aa9d4785ce6027 (patch)
tree0b13f5ef64238264bac8370bd768a5aab136b215 /src/network
parent849ad907d49e6f6866dc81c0e3a94514bdc69b40 (diff)
downloadQt-5a488f8022626e71681ae42662aa9d4785ce6027.zip
Qt-5a488f8022626e71681ae42662aa9d4785ce6027.tar.gz
Qt-5a488f8022626e71681ae42662aa9d4785ce6027.tar.bz2
Fix http proxy connections hanging on network error
The http socket engine was hiding errors other than RemoteHostClosedError. This caused problems, because for other errors, the low level socket is still closed in the native socket engine. By not emitting the read notification, the error was never informed to QAbstractSocket and as a result, the application never gets the disconnected signal. Reviewed-by: Martin Petersson
Diffstat (limited to 'src/network')
-rw-r--r--src/network/socket/qhttpsocketengine.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/network/socket/qhttpsocketengine.cpp b/src/network/socket/qhttpsocketengine.cpp
index 6a025f2..598efb6 100644
--- a/src/network/socket/qhttpsocketengine.cpp
+++ b/src/network/socket/qhttpsocketengine.cpp
@@ -704,11 +704,10 @@ void QHttpSocketEngine::slotSocketError(QAbstractSocket::SocketError error)
d->state = None;
setError(error, d->socket->errorString());
- if (error == QAbstractSocket::RemoteHostClosedError) {
- emitReadNotification();
- } else {
+ if (error != QAbstractSocket::RemoteHostClosedError)
qDebug() << "QHttpSocketEngine::slotSocketError: got weird error =" << error;
- }
+ //read notification needs to always be emitted, otherwise the higher layer doesn't get the disconnected signal
+ emitReadNotification();
}
void QHttpSocketEngine::slotSocketStateChanged(QAbstractSocket::SocketState state)