From 54c487cdd2950ac447f9164a9fea2d0468d87433 Mon Sep 17 00:00:00 2001 From: Martin Petersson Date: Mon, 19 Dec 2011 11:02:46 +0100 Subject: QNetworkAccessManager: delay IPv4 or IPv6 based on getaddrinfo order Instead of always delaying IPv4 when we have both Ipv4 and IPv6 we should use the order we get from getaddrinfo to descide which one that should be delayed. Task-number: QTBUG-23066 Change-Id: Ibe8c4d7000abd6e57fe8c6afac8a4a843e17ff27 Reviewed-by: Peter Hartmann Reviewed-by: Thiago Macieira Reviewed-by: Shane Kearns --- src/network/access/qhttpnetworkconnection_p.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/network/access/qhttpnetworkconnection_p.h') diff --git a/src/network/access/qhttpnetworkconnection_p.h b/src/network/access/qhttpnetworkconnection_p.h index 18ec92a07a..75da382145 100644 --- a/src/network/access/qhttpnetworkconnection_p.h +++ b/src/network/access/qhttpnetworkconnection_p.h @@ -135,7 +135,7 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_startNextRequest()) Q_PRIVATE_SLOT(d_func(), void _q_hostLookupFinished(QHostInfo)) - Q_PRIVATE_SLOT(d_func(), void _q_connectIPv4Channel()) + Q_PRIVATE_SLOT(d_func(), void _q_connectDelayedChannel()) }; @@ -198,7 +198,7 @@ public: void _q_startNextRequest(); // send the next request from the queue void _q_hostLookupFinished(QHostInfo info); - void _q_connectIPv4Channel(); + void _q_connectDelayedChannel(); void createAuthorization(QAbstractSocket *socket, QHttpNetworkRequest &request); @@ -210,9 +210,10 @@ public: QString hostName; quint16 port; bool encrypt; + bool delayIpv4; const int channelCount; - QTimer ipv4ConnectTimer; + QTimer delayedConnectionTimer; QHttpNetworkConnectionChannel *channels; // parallel connections to the server bool shouldEmitChannelError(QAbstractSocket *socket); -- cgit v1.2.3