Bug 1329911 - Fix incorrect releasing of POST data. r=mayhemer
authorWei-Cheng Pan <wpan@mozilla.com>
Fri, 13 Jan 2017 17:33:36 +0800
changeset 374606 792c6f70dde581401b8afedd6e96bb4ad37f9655
parent 374605 af6601db2875a82cbba7983858cea78455b24b74
child 374638 3e275d37a06236981bff399b7d7aa0646be3fee7
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmayhemer
bugs1329911, 1264566, 1293765
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1329911 - Fix incorrect releasing of POST data. r=mayhemer This patch reverts bug 1264566 (part 3) and bug 1293765. MozReview-Commit-ID: AsSxxAMGHvV
netwerk/protocol/http/HttpChannelChild.cpp
netwerk/protocol/http/nsHttpChannel.cpp
--- a/netwerk/protocol/http/HttpChannelChild.cpp
+++ b/netwerk/protocol/http/HttpChannelChild.cpp
@@ -872,18 +872,16 @@ 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
@@ -6614,25 +6614,16 @@ 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");
 
-    if (!mAuthRetryPending) {
-        // We must not release the upload stream (that may contain POST data)
-        // before we finish any authentication loops happing during lifetime
-        // of this very channel.  Otherwise, we may loose the upload data when
-        // authenticating to e.g. an NTLM authenticated site.
-        LOG(("  dropping upload stream"));
-        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)) {