QHttpNetworkConnection: Always set proxy settings to all channels

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 <marten.nordheim@qt.io>
(cherry picked from commit 66f0149693c810a512001d9d4df89b6f9d7a9327)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Andrey Mozzhuhin 2022-01-11 00:18:30 +03:00 committed by Qt Cherry-pick Bot
parent b358b38922
commit 8e88689739

View File

@ -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);
}