commit ad850b708058ed1169452ac8d504ff7a01b755ba
parent 53da81d4b770bd70e5780b1d4efdeb8f4ebf7295
Author: Kershaw Chang <kershaw@mozilla.com>
Date: Mon, 3 Nov 2025 15:49:03 +0000
Bug 1984563 - Ensure the only error when dispatching to HTTP/2 connection is LNA error, r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D269008
Diffstat:
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/netwerk/protocol/http/nsHttpConnectionMgr.cpp b/netwerk/protocol/http/nsHttpConnectionMgr.cpp
@@ -1984,9 +1984,14 @@ void nsHttpConnectionMgr::DispatchSpdyPendingQ(
nsresult rv =
DispatchTransaction(ent, pendingTransInfo->Transaction(), conn);
if (NS_FAILED(rv)) {
- // this cannot happen, but if due to some bug it does then
- // close the transaction
- MOZ_ASSERT(false, "Dispatch SPDY Transaction");
+ // Dispatching a transaction to an existing HTTP/2 session should not
+ // fail. The only expected failure here is
+ // NS_ERROR_LOCAL_NETWORK_ACCESS_DENIED (e.g., when a
+ // speculative/preconnected HTTP/2 session was created before). Any other
+ // rv indicates a bug.
+ MOZ_ASSERT(rv == NS_ERROR_LOCAL_NETWORK_ACCESS_DENIED,
+ "Dispatch H2 transaction should only fail with Local Network "
+ "Access denied");
LOG(("ProcessSpdyPendingQ Dispatch Transaction failed trans=%p\n",
pendingTransInfo->Transaction()));
pendingTransInfo->Transaction()->Close(rv);