From 8e886897397e13f04685ef638c5037fbb3b7ae10 Mon Sep 17 00:00:00 2001 From: Andrey Mozzhuhin Date: Tue, 11 Jan 2022 00:18:30 +0300 Subject: [PATCH] QHttpNetworkConnection: Always set proxy settings to all channels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Proxy settings should always be set to all channels because after switching from HTTP/2 to HTTP/1.1 they may all be used. Problem was made in commit 8b9d246225dcd63900399297b0fd553918840bea. It is introduce the QHttpNetworkConnectionPrivate::activeChannel field, which value is 1 got HTTP/2 by default, but can later be changed to 6 if the remote host doesn't support HTTP/2. Change-Id: Idcdeb22ec806520965f30a22045f99aa009a7362 Reviewed-by: MÃ¥rten Nordheim (cherry picked from commit 66f0149693c810a512001d9d4df89b6f9d7a9327) Reviewed-by: Qt Cherry-pick Bot --- src/network/access/qhttpnetworkconnection.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index 18134dda13a..a61d16592f2 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -1394,7 +1394,7 @@ void QHttpNetworkConnection::setCacheProxy(const QNetworkProxy &networkProxy) d->networkProxy = networkProxy; // update the authenticator if (!d->networkProxy.user().isEmpty()) { - for (int i = 0; i < d->activeChannelCount; ++i) { + for (int i = 0; i < d->channelCount; ++i) { d->channels[i].proxyAuthenticator.setUser(d->networkProxy.user()); d->channels[i].proxyAuthenticator.setPassword(d->networkProxy.password()); } @@ -1410,7 +1410,7 @@ QNetworkProxy QHttpNetworkConnection::cacheProxy() const void QHttpNetworkConnection::setTransparentProxy(const QNetworkProxy &networkProxy) { Q_D(QHttpNetworkConnection); - for (int i = 0; i < d->activeChannelCount; ++i) + for (int i = 0; i < d->channelCount; ++i) d->channels[i].setProxy(networkProxy); }