diff options
author | Mårten Nordheim <marten.nordheim@qt.io> | 2020-08-12 12:12:18 +0200 |
---|---|---|
committer | Mårten Nordheim <marten.nordheim@qt.io> | 2020-08-13 19:58:11 +0200 |
commit | 5ecc6eb36365e5382ac18b268a885fc17a3abf9f (patch) | |
tree | 6532a64395c6eb0d787852de7efc4d0d18d2b9c6 /src/network/access | |
parent | c808bd0b60543127686231ce9ebbb2b6331387b2 (diff) |
QNAM: Fix proxy auth handling when requesting but not yet changed to h2
In some cases (i.e. with SOCKS) we don't have a HTTP/2 request ready
yet so it would just error out.
Change-Id: I6449de5fb52f5208d5641062c5906c3baff18b77
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/network/access')
-rw-r--r-- | src/network/access/qhttpnetworkconnection.cpp | 3 | ||||
-rw-r--r-- | src/network/access/qhttpnetworkconnectionchannel.cpp | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index 8c108689a5..3a5ce9c6c9 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -1514,7 +1514,8 @@ void QHttpNetworkConnectionPrivate::emitProxyAuthenticationRequired(const QHttpN // dialog is displaying pauseConnection(); QHttpNetworkReply *reply; - if (connectionType == QHttpNetworkConnection::ConnectionTypeHTTP2 + if ((connectionType == QHttpNetworkConnection::ConnectionTypeHTTP2 + && (chan->switchedToHttp2 || chan->h2RequestsToSend.count() > 0)) || connectionType == QHttpNetworkConnection::ConnectionTypeHTTP2Direct) { // we choose the reply to emit the proxyAuth signal from somewhat arbitrarily, // but that does not matter because the signal will ultimately be emitted diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp index b85d718f5f..0c59c20255 100644 --- a/src/network/access/qhttpnetworkconnectionchannel.cpp +++ b/src/network/access/qhttpnetworkconnectionchannel.cpp @@ -1133,7 +1133,8 @@ void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socket #ifndef QT_NO_NETWORKPROXY void QHttpNetworkConnectionChannel::_q_proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator* auth) { - if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2 + if ((connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2 + && (switchedToHttp2 || h2RequestsToSend.count() > 0)) || connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2Direct) { if (h2RequestsToSend.count() > 0) connection->d_func()->emitProxyAuthenticationRequired(this, proxy, auth); |