summaryrefslogtreecommitdiff
path: root/src/network/socket/qhttpsocketengine.cpp
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2011-02-28 19:32:55 +0000
committerShane Kearns <shane.kearns@accenture.com>2011-03-08 18:48:41 +0000
commit5a488f8022626e71681ae42662aa9d4785ce6027 (patch)
tree0b13f5ef64238264bac8370bd768a5aab136b215 /src/network/socket/qhttpsocketengine.cpp
parent849ad907d49e6f6866dc81c0e3a94514bdc69b40 (diff)
downloadqt4-tools-5a488f8022626e71681ae42662aa9d4785ce6027.tar.gz
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/socket/qhttpsocketengine.cpp')
-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 6a025f2597..598efb66a4 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)