summaryrefslogtreecommitdiffstats
path: root/src/network/access/qhttpnetworkconnection.cpp
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2011-05-05 15:03:14 (GMT)
committerShane Kearns <shane.kearns@accenture.com>2011-05-05 15:21:00 (GMT)
commit57e191e9cb69cd132612122b30c94ee013ef4a50 (patch)
tree82adae4ef8b210af4060b6fa3f20c9ba7fb74576 /src/network/access/qhttpnetworkconnection.cpp
parenta1b150981d58276e7937c4e3daebea5ffe05c17d (diff)
downloadQt-57e191e9cb69cd132612122b30c94ee013ef4a50.zip
Qt-57e191e9cb69cd132612122b30c94ee013ef4a50.tar.gz
Qt-57e191e9cb69cd132612122b30c94ee013ef4a50.tar.bz2
Update QTBUG-17223 for Qt 4.8
In Qt 4.7, http network requests are assigned to http connection channels before connecting the channel. In Qt 4.8, channels are connected "blind" as this gives a performance improvement in certain circumstances. On the assumption that User-Agent should be the same for all the requests being sent to the server in a given burst, we use the first queued request to set the user agent for a http proxy. Task-number: QTBUG-17223 Reviewed-by: Markus Goetz Reviewed-by: Martin Petersson
Diffstat (limited to 'src/network/access/qhttpnetworkconnection.cpp')
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index 83156c6..478bef0 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -520,6 +520,15 @@ bool QHttpNetworkConnectionPrivate::dequeueRequest(QAbstractSocket *socket)
return false;
}
+QHttpNetworkRequest QHttpNetworkConnectionPrivate::predictNextRequest()
+{
+ if (!highPriorityQueue.isEmpty())
+ return highPriorityQueue.last().first;
+ if (!lowPriorityQueue.isEmpty())
+ return lowPriorityQueue.last().first;
+ return QHttpNetworkRequest();
+}
+
// this is called from _q_startNextRequest and when a request has been sent down a socket from the channel
void QHttpNetworkConnectionPrivate::fillPipeline(QAbstractSocket *socket)
{