Bug 1264566 - Part 3: Release upload stream after request complete. r?valentin
MozReview-Commit-ID: 5r1fEkOy9vU
--- a/netwerk/protocol/http/HttpChannelChild.cpp
+++ b/netwerk/protocol/http/HttpChannelChild.cpp
@@ -847,16 +847,18 @@ HttpChannelChild::MaybeDivertOnStop(cons
void
HttpChannelChild::OnStopRequest(const nsresult& channelStatus,
const ResourceTimingStruct& timing)
{
LOG(("HttpChannelChild::OnStopRequest [this=%p status=%x]\n",
this, channelStatus));
+ mUploadStream = nullptr;
+
if (mDivertingToParent) {
MOZ_RELEASE_ASSERT(!mFlushedForDiversion,
"Should not be processing any more callbacks from parent!");
SendDivertOnStopRequest(channelStatus);
return;
}
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -6202,16 +6202,18 @@ nsHttpChannel::OnStopRequest(nsIRequest
js::ProfileEntry::Category::NETWORK);
LOG(("nsHttpChannel::OnStopRequest [this=%p request=%p status=%x]\n",
this, request, status));
MOZ_ASSERT(NS_IsMainThread(),
"OnStopRequest should only be called from the main thread");
+ mUploadStream = nullptr;
+
if (NS_FAILED(status)) {
ProcessSecurityReport(status);
}
// If this load failed because of a security error, it may be because we
// are in a captive portal - trigger an async check to make sure.
int32_t nsprError = -1 * NS_ERROR_GET_CODE(status);
if (mozilla::psm::IsNSSErrorCode(nsprError)) {