diff options
author | Mårten Nordheim <marten.nordheim@qt.io> | 2019-06-21 09:20:39 +0200 |
---|---|---|
committer | Mårten Nordheim <marten.nordheim@qt.io> | 2019-06-25 17:20:35 +0200 |
commit | 89655525ae56dd9662f1873efdce72cbff7bb932 (patch) | |
tree | a11f973efcfc069a19378f1dac13290e67f9fa1d /src/network/access/qhttpnetworkconnectionchannel.cpp | |
parent | e21169796297f752a62db25c722ff8e2ff66d8dc (diff) |
QHttpNetworkConnection: Change assert to early return and handle Http2
When using a http proxy (and presumably other proxies) we might have
failed/aborted (aka "finished") the request and _then_ receive a
"proxy authentication required" message from the proxy. In this case
there is no spdy/http2 reply in the queue, so asserting is wrong.
Change-Id: Id9b76b580299f6a6cd6efad62d6aaf63183816fb
Fixes: QTBUG-76426
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/network/access/qhttpnetworkconnectionchannel.cpp')
-rw-r--r-- | src/network/access/qhttpnetworkconnectionchannel.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp index 074c389689..38adca2633 100644 --- a/src/network/access/qhttpnetworkconnectionchannel.cpp +++ b/src/network/access/qhttpnetworkconnectionchannel.cpp @@ -1115,11 +1115,13 @@ void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socket void QHttpNetworkConnectionChannel::_q_proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator* auth) { if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2 + || connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2Direct #ifndef QT_NO_SSL || connection->connectionType() == QHttpNetworkConnection::ConnectionTypeSPDY #endif ) { - connection->d_func()->emitProxyAuthenticationRequired(this, proxy, auth); + if (spdyRequestsToSend.count() > 0) + connection->d_func()->emitProxyAuthenticationRequired(this, proxy, auth); } else { // HTTP // Need to dequeue the request before we can emit the error. if (!reply) |