commit 2c7d76a615728d88038353b7df492a9ad5ffe2d1
parent 6e47dbc7c4fc6cd0fa7ac9c200212c56b781c370
Author: Kershaw Chang <kershaw@mozilla.com>
Date: Thu, 2 Oct 2025 09:06:13 +0000
Bug 1991426 - Adjust debug assertions for outer-connection fallback, r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D266976
Diffstat:
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/netwerk/protocol/http/HttpConnectionUDP.cpp b/netwerk/protocol/http/HttpConnectionUDP.cpp
@@ -900,7 +900,12 @@ void HttpConnectionUDP::CloseTransaction(nsAHttpTransaction* trans,
"]\n",
this, trans, static_cast<uint32_t>(reason)));
- MOZ_ASSERT(trans == mHttp3Session);
+ // CloseTransaction may be called by nsHttpTransaction when a fallback
+ // is needed. In this case, the transaction is still in mQueuedTransaction
+ // and the proxy connect is still in progress.
+ bool transInQueue = mQueuedTransaction.Contains(trans);
+ MOZ_ASSERT(trans == mHttp3Session ||
+ (transInQueue && IsProxyConnectInProgress()));
MOZ_ASSERT(OnSocketThread(), "not on socket thread");
if (NS_SUCCEEDED(reason) || (reason == NS_BASE_STREAM_CLOSED)) {
@@ -919,7 +924,7 @@ void HttpConnectionUDP::CloseTransaction(nsAHttpTransaction* trans,
if (mHttp3Session) {
// When proxy connnect failed, we call Http3Session::SetCleanShutdown to
// force Http3Session to release this UDP connection.
- mHttp3Session->SetCleanShutdown(aIsShutdown ||
+ mHttp3Session->SetCleanShutdown(aIsShutdown || transInQueue ||
(mIsInTunnel && !mProxyConnectSucceeded));
mHttp3Session->Close(reason);
if (!mHttp3Session->IsClosed()) {
diff --git a/netwerk/protocol/http/nsHttpTransaction.cpp b/netwerk/protocol/http/nsHttpTransaction.cpp
@@ -3589,7 +3589,6 @@ void nsHttpTransaction::OnFastFallbackTimer() {
void nsHttpTransaction::HandleFallback(
nsHttpConnectionInfo* aFallbackConnInfo) {
if (mConnection) {
- MOZ_ASSERT(mActivated);
// Close the transaction with NS_ERROR_NET_RESET, since we know doing this
// will make transaction to be restarted.
mConnection->CloseTransaction(this, NS_ERROR_NET_RESET);