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.

Pick-to: 6.3 6.2 5.15
Change-Id: Idcdeb22ec806520965f30a22045f99aa009a7362
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Andrey Mozzhuhin 2022-01-11 00:18:30 +03:00 committed by Mårten Nordheim
parent 3acfd39653
commit 66f0149693

View File

@ -1404,7 +1404,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());
}
@ -1420,7 +1420,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);
}