summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
Diffstat (limited to 'src/network')
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp16
-rw-r--r--src/network/kernel/qhostaddress.h6
2 files changed, 21 insertions, 1 deletions
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index 1c7a61dca6..7aee9aa38a 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -1185,6 +1185,22 @@ void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socket
case QAbstractSocket::SslHandshakeFailedError:
errorCode = QNetworkReply::SslHandshakeFailedError;
break;
+ case QAbstractSocket::ProxyConnectionClosedError:
+ // try to reconnect/resend before sending an error.
+ if (reconnectAttempts-- > 0) {
+ closeAndResendCurrentRequest();
+ return;
+ }
+ errorCode = QNetworkReply::ProxyConnectionClosedError;
+ break;
+ case QAbstractSocket::ProxyConnectionTimeoutError:
+ // try to reconnect/resend before sending an error.
+ if (reconnectAttempts-- > 0) {
+ closeAndResendCurrentRequest();
+ return;
+ }
+ errorCode = QNetworkReply::ProxyTimeoutError;
+ break;
default:
// all other errors are treated as NetworkError
errorCode = QNetworkReply::UnknownNetworkError;
diff --git a/src/network/kernel/qhostaddress.h b/src/network/kernel/qhostaddress.h
index 77a2ec4105..49032850be 100644
--- a/src/network/kernel/qhostaddress.h
+++ b/src/network/kernel/qhostaddress.h
@@ -64,6 +64,10 @@ public:
typedef QIPv6Address Q_IPV6ADDR;
+class QHostAddress;
+// qHash is a friend, but we can't use default arguments for friends (ยง8.3.6.4)
+Q_NETWORK_EXPORT uint qHash(const QHostAddress &key, uint seed = 0);
+
class Q_NETWORK_EXPORT QHostAddress
{
public:
@@ -121,7 +125,7 @@ public:
static QPair<QHostAddress, int> parseSubnet(const QString &subnet);
- friend Q_NETWORK_EXPORT uint qHash(const QHostAddress &key, uint seed = 0);
+ friend Q_NETWORK_EXPORT uint qHash(const QHostAddress &key, uint seed);
protected:
QScopedPointer<QHostAddressPrivate> d;
};