diff options
author | Markus Goetz <Markus.Goetz@nokia.com> | 2010-10-15 15:01:37 (GMT) |
---|---|---|
committer | Markus Goetz <Markus.Goetz@nokia.com> | 2010-10-15 15:10:27 (GMT) |
commit | b498c15ebbf120819f73fe761388fd63c2de4b23 (patch) | |
tree | ccdb24c89002f9ba4a0469e6421a9d0e90bfb19d /src | |
parent | 7b32da4af8b6f305185d1c22d1425164b00e5391 (diff) | |
download | Qt-b498c15ebbf120819f73fe761388fd63c2de4b23.zip Qt-b498c15ebbf120819f73fe761388fd63c2de4b23.tar.gz Qt-b498c15ebbf120819f73fe761388fd63c2de4b23.tar.bz2 |
QNAM HTTP: Fix error signal emission for unreachable IPs
This commit fixes getFromUnreachableIp()
Reviewed-by: Thiago Macieira
Task-Number: QTBUG-10679
Diffstat (limited to 'src')
-rw-r--r-- | src/network/access/qhttpnetworkconnectionchannel.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp index 6437f6f..d10f951 100644 --- a/src/network/access/qhttpnetworkconnectionchannel.cpp +++ b/src/network/access/qhttpnetworkconnectionchannel.cpp @@ -105,12 +105,22 @@ void QHttpNetworkConnectionChannel::init() QObject::connect(socket, SIGNAL(readyRead()), this, SLOT(_q_readyRead()), Qt::DirectConnection); + + // The disconnected() and error() signals may already come + // while calling connectToHost(). + // In case of a cached hostname or an IP this + // will then emit a signal to the user of QNetworkReply + // but cannot be caught because the user did not have a chance yet + // to connect to QNetworkReply's signals. + qRegisterMetaType<QAbstractSocket::SocketError>("QAbstractSocket::SocketError"); QObject::connect(socket, SIGNAL(disconnected()), this, SLOT(_q_disconnected()), - Qt::DirectConnection); + Qt::QueuedConnection); QObject::connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(_q_error(QAbstractSocket::SocketError)), - Qt::DirectConnection); + Qt::QueuedConnection); + + #ifndef QT_NO_NETWORKPROXY QObject::connect(socket, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)), this, SLOT(_q_proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)), |