Bug 1264566 - Part 3: Release upload stream after request complete. r?valentin draft
authorWei-Cheng Pan <wpan@mozilla.com>
Fri, 24 Jun 2016 18:12:32 +0800
changeset 387517 1d6336993f5c81f6fd75fdc06cb82dcdafbb7801
parent 387516 26ca0d28089b54975aa13d71cd21a15fef45830e
child 387518 c47f2bc7ca91f5ad99379a0b40ffd9ba0305c643
push id22974
push userbmo:wpan@mozilla.com
push dateThu, 14 Jul 2016 06:19:47 +0000
reviewersvalentin
bugs1264566
milestone50.0a1
Bug 1264566 - Part 3: Release upload stream after request complete. r?valentin MozReview-Commit-ID: 5r1fEkOy9vU
netwerk/protocol/http/HttpChannelChild.cpp
netwerk/protocol/http/nsHttpChannel.cpp
--- 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)) {