Bug 1329911 - Fix incorrect releasing of POST data. r?mayhemer
This patch reverts
bug 1264566 (part 3) and
bug 1293765.
MozReview-Commit-ID: AsSxxAMGHvV
--- 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)) {