tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit ed5d8b39aa223d2c9f083c958bc46d44f884d56d
parent 0c75044fa77d949dfbcf097a945c7cbf743416c0
Author: Kershaw Chang <kershaw@mozilla.com>
Date:   Wed,  3 Dec 2025 08:12:14 +0000

Bug 1998489 - In Http2Stream::CloseStream, only call DoNotRemoveAltSvc when MASQUE is used, r=necko-reviewers,valentin

Differential Revision: https://phabricator.services.mozilla.com/D274566

Diffstat:
Mnetwerk/protocol/http/Http2Stream.cpp | 9+++++----
Mnetwerk/protocol/http/nsHttpTransaction.cpp | 4++++
2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/netwerk/protocol/http/Http2Stream.cpp b/netwerk/protocol/http/Http2Stream.cpp @@ -33,10 +33,11 @@ Http2Stream::Http2Stream(nsAHttpTransaction* httpTransaction, Http2Stream::~Http2Stream() {} void Http2Stream::CloseStream(nsresult reason) { - if (reason == NS_ERROR_NET_RESET) { - // If we got NS_ERROR_NET_RESET, the transaction will be retried. Keep the - // Alt-Svc in the connection info. Dropping it could trigger an - // unintended proxy connection fallback. + if (reason == NS_ERROR_NET_RESET && + mTransaction->ConnectionInfo()->IsHttp3ProxyConnection()) { + // If we got NS_ERROR_NET_RESET, the transaction will be retried. When + // MASQUE proxy is used, keep the Alt-Svc in the connection info. Dropping + // it could trigger an unintended proxy connection fallback. mTransaction->DoNotRemoveAltSvc(); } mTransaction->Close(reason); diff --git a/netwerk/protocol/http/nsHttpTransaction.cpp b/netwerk/protocol/http/nsHttpTransaction.cpp @@ -3457,6 +3457,10 @@ void nsHttpTransaction::OnBackupConnectionReady(bool aTriggeredByHTTPSRR) { } if (mConnection) { + if (mConnection->Version() != HttpVersion::v3_0) { + LOG(("Already have non-HTTP/3 conn:%p", mConnection.get())); + return; + } // The transaction will only be restarted when we already have a connection. // When there is no connection, this transaction will be moved to another // connection entry.