Bug 1802471 - nsHttpChannel::MaybeResolveProxyAndBeginConnect should not call BeginConnect if the handler is not active. r=necko-reviewers,kershaw

Differential Revision: https://phabricator.services.mozilla.com/D163125
This commit is contained in:
Jens Stutte 2022-11-25 16:09:02 +00:00
parent cfebc1bd3c
commit 4c64d1115a

View File

@ -6018,7 +6018,15 @@ void nsHttpChannel::MaybeResolveProxyAndBeginConnect() {
return;
}
rv = BeginConnect();
if (!gHttpHandler->Active()) {
LOG(
("nsHttpChannel::MaybeResolveProxyAndBeginConnect [this=%p] "
"Handler no longer active.\n",
this));
rv = NS_ERROR_NOT_AVAILABLE;
} else {
rv = BeginConnect();
}
if (NS_FAILED(rv)) {
CloseCacheEntry(false);
Unused << AsyncAbort(rv);
@ -6069,6 +6077,9 @@ nsresult nsHttpChannel::BeginConnect() {
LOG(("nsHttpChannel::BeginConnect [this=%p]\n", this));
nsresult rv;
// It is the caller's responsibility to not call us late in shutdown.
MOZ_ASSERT(gHttpHandler->Active());
// Construct connection info object
nsAutoCString host;
nsAutoCString scheme;