From f5e748a2d9e14f2059e3f3e7a70f5d6f94b70444 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Thu, 23 Apr 2020 00:57:40 +0000 Subject: [PATCH] Bug 1607984 - P10. Wait until OnStopRequest has been called to clear mRequest. ?valentin r=valentin The code assumed that nsJARChannel::RetargetDeliveryTo would have been called synchronously from nsJARChannel::OnStartRequest, which would be true if we weren't using a DocumentChannel. The DocumentLoadListener queue the calls to OnStartRequest until the final redirect. nsJARChannel::RetargetDelivery mRequest member is be set to forward the call. So we need to only reset it once OnStopRequest has been received. Differential Revision: https://phabricator.services.mozilla.com/D70007 --- modules/libjar/nsJARChannel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/libjar/nsJARChannel.cpp b/modules/libjar/nsJARChannel.cpp index 341f5fc0837b..4c84d4595d38 100644 --- a/modules/libjar/nsJARChannel.cpp +++ b/modules/libjar/nsJARChannel.cpp @@ -997,7 +997,6 @@ nsJARChannel::OnStartRequest(nsIRequest* req) { mRequest = req; nsresult rv = mListener->OnStartRequest(this); - mRequest = nullptr; if (NS_FAILED(rv)) { return rv; } @@ -1038,6 +1037,7 @@ nsJARChannel::OnStopRequest(nsIRequest* req, nsresult status) { if (mLoadGroup) mLoadGroup->RemoveRequest(this, nullptr, status); + mRequest = nullptr; mPump = nullptr; mIsPending = false;