diff options
author | Mårten Nordheim <marten.nordheim@qt.io> | 2020-12-01 12:02:04 +0100 |
---|---|---|
committer | Mårten Nordheim <marten.nordheim@qt.io> | 2020-12-02 10:17:13 +0100 |
commit | def1b9784958dbf4459618d15daeae69ed5af332 (patch) | |
tree | 07a46cabc31c545478beee9f66eba4cc59a21a7d /src/network | |
parent | 65bcac95a7a051d4343aaa3c5ff8b39494aa14e4 (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
Pick-to: 5.15 6.0
Change-Id: If37b8c71ac36597adc305fb1b1ea4fa7b48b0d28
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/access/qhttpnetworkconnection.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index c133a09044..3508f9a629 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -1064,8 +1064,10 @@ void QHttpNetworkConnectionPrivate::_q_startNextRequest() } case QHttpNetworkConnection::ConnectionTypeHTTP2Direct: case QHttpNetworkConnection::ConnectionTypeHTTP2: { - if (channels[0].h2RequestsToSend.isEmpty() && channels[0].switchedToHttp2) + if (channels[0].h2RequestsToSend.isEmpty() && !channels[0].reply + && highPriorityQueue.isEmpty() && lowPriorityQueue.isEmpty()) { return; + } if (networkLayerState == IPv4) channels[0].networkLayerPreference = QAbstractSocket::IPv4Protocol; |