summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2020-12-01 12:02:04 +0100
committerMårten Nordheim <marten.nordheim@qt.io>2020-12-03 12:40:50 +0100
commit4c9c7d543426da66fc32935bbf8659313998d01f (patch)
tree60d2456c2e2907fb1cb745b0dfeeb2173147b817
parent9ef14f84219c0ea77ebc6eb63aeb17483c4c726c (diff)
Http2: don't call ensureConnection when there's no request available
Previously we only checked if there was something in the h2 queue or if we had not yet switched to http2. These means in some cases that following an error it would enter this branch and, because it had not yet switched to http2, it would call 'ensureConnection' which would try start a reconnection. This could make the proxy socket engines try to emit 'auth required' with no replies, meaning nothing happens. Fixes: QTBUG-88417 Change-Id: If37b8c71ac36597adc305fb1b1ea4fa7b48b0d28 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit def1b9784958dbf4459618d15daeae69ed5af332)
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index b0116319b0..9745f3b322 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -1077,8 +1077,10 @@ void QHttpNetworkConnectionPrivate::_q_startNextRequest()
case QHttpNetworkConnection::ConnectionTypeHTTP2Direct:
case QHttpNetworkConnection::ConnectionTypeHTTP2:
case QHttpNetworkConnection::ConnectionTypeSPDY: {
- if (channels[0].spdyRequestsToSend.isEmpty() && channels[0].switchedToHttp2)
+ if (channels[0].spdyRequestsToSend.isEmpty() && !channels[0].reply
+ && highPriorityQueue.isEmpty() && lowPriorityQueue.isEmpty()) {
return;
+ }
if (networkLayerState == IPv4)
channels[0].networkLayerPreference = QAbstractSocket::IPv4Protocol;