diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-03-15 09:11:31 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-03-15 09:11:31 +0100 |
commit | 82b361dc4463b13ebda30090e239db487f5aa308 (patch) | |
tree | fdc6fd06e695188735d636da57b02b6c7e0c1c5f /netwerk | |
parent | 4bb98e2b61ce75d7f5d19398b658441a7ceed04b (diff) | |
parent | 71429dc7ecc496c5924c770746e8c28449ecb7a2 (diff) | |
download | UXP-82b361dc4463b13ebda30090e239db487f5aa308.tar UXP-82b361dc4463b13ebda30090e239db487f5aa308.tar.gz UXP-82b361dc4463b13ebda30090e239db487f5aa308.tar.lz UXP-82b361dc4463b13ebda30090e239db487f5aa308.tar.xz UXP-82b361dc4463b13ebda30090e239db487f5aa308.zip |
Merge branch 'ported-upstream'
Diffstat (limited to 'netwerk')
-rw-r--r-- | netwerk/protocol/http/Http2Session.cpp | 18 | ||||
-rw-r--r-- | netwerk/protocol/http/Http2Stream.cpp | 14 | ||||
-rw-r--r-- | netwerk/protocol/http/Http2Stream.h | 1 | ||||
-rw-r--r-- | netwerk/protocol/http/HttpBaseChannel.cpp | 8 | ||||
-rw-r--r-- | netwerk/protocol/http/HttpChannelParent.cpp | 2 | ||||
-rw-r--r-- | netwerk/protocol/http/HttpChannelParent.h | 2 |
6 files changed, 30 insertions, 15 deletions
diff --git a/netwerk/protocol/http/Http2Session.cpp b/netwerk/protocol/http/Http2Session.cpp index 55ddbe908..4f350af83 100644 --- a/netwerk/protocol/http/Http2Session.cpp +++ b/netwerk/protocol/http/Http2Session.cpp @@ -1044,6 +1044,15 @@ Http2Session::CleanupStream(Http2Stream *aStream, nsresult aResult, return; } + Http2PushedStream *pushSource = aStream->PushSource(); + if (pushSource) { + // aStream is a synthetic attached to an even push + MOZ_ASSERT(pushSource->GetConsumerStream() == aStream); + MOZ_ASSERT(!aStream->StreamID()); + MOZ_ASSERT(!(pushSource->StreamID() & 0x1)); + aStream->ClearPushSource(); + } + if (aStream->DeferCleanup(aResult)) { LOG3(("Http2Session::CleanupStream 0x%X deferred\n", aStream->StreamID())); return; @@ -1054,15 +1063,6 @@ Http2Session::CleanupStream(Http2Stream *aStream, nsresult aResult, return; } - Http2PushedStream *pushSource = aStream->PushSource(); - if (pushSource) { - // aStream is a synthetic attached to an even push - MOZ_ASSERT(pushSource->GetConsumerStream() == aStream); - MOZ_ASSERT(!aStream->StreamID()); - MOZ_ASSERT(!(pushSource->StreamID() & 0x1)); - pushSource->SetConsumerStream(nullptr); - } - // don't reset a stream that has recevied a fin or rst if (!aStream->RecvdFin() && !aStream->RecvdReset() && aStream->StreamID() && !(mInputFrameFinal && (aStream == mInputFrameDataStream))) { // !(recvdfin with mark pending) diff --git a/netwerk/protocol/http/Http2Stream.cpp b/netwerk/protocol/http/Http2Stream.cpp index f49c1f138..7a8f96855 100644 --- a/netwerk/protocol/http/Http2Stream.cpp +++ b/netwerk/protocol/http/Http2Stream.cpp @@ -103,10 +103,20 @@ Http2Stream::Http2Stream(nsAHttpTransaction *httpTransaction, Http2Stream::~Http2Stream() { + ClearPushSource(); ClearTransactionsBlockedOnTunnel(); mStreamID = Http2Session::kDeadStreamID; } +void +Http2Stream::ClearPushSource() +{ + if (mPushSource) { + mPushSource->SetConsumerStream(nullptr); + mPushSource = nullptr; + } +} + // ReadSegments() is used to write data down the socket. Generally, HTTP // request data is pulled from the approriate transaction and // converted to HTTP/2 data. Sometimes control data like a window-update is @@ -1083,6 +1093,10 @@ Http2Stream::ConvertPushHeaders(Http2Decompressor *decompressor, void Http2Stream::Close(nsresult reason) { + // In case we are connected to a push, make sure the push knows we are closed, + // so it doesn't try to give us any more DATA that comes on it after our close. + ClearPushSource(); + mTransaction->Close(reason); } diff --git a/netwerk/protocol/http/Http2Stream.h b/netwerk/protocol/http/Http2Stream.h index 968461ee4..8783eefed 100644 --- a/netwerk/protocol/http/Http2Stream.h +++ b/netwerk/protocol/http/Http2Stream.h @@ -50,6 +50,7 @@ public: uint32_t StreamID() { return mStreamID; } Http2PushedStream *PushSource() { return mPushSource; } + void ClearPushSource(); stateType HTTPState() { return mState; } void SetHTTPState(stateType val) { mState = val; } diff --git a/netwerk/protocol/http/HttpBaseChannel.cpp b/netwerk/protocol/http/HttpBaseChannel.cpp index 0ff792280..278c94db0 100644 --- a/netwerk/protocol/http/HttpBaseChannel.cpp +++ b/netwerk/protocol/http/HttpBaseChannel.cpp @@ -2480,9 +2480,9 @@ HttpBaseChannel::GetFetchCacheMode(uint32_t* aFetchCacheMode) *aFetchCacheMode = nsIHttpChannelInternal::FETCH_CACHE_MODE_RELOAD; } else if (mLoadFlags & VALIDATE_ALWAYS) { *aFetchCacheMode = nsIHttpChannelInternal::FETCH_CACHE_MODE_NO_CACHE; - } else if (mLoadFlags & (LOAD_FROM_CACHE | nsICachingChannel::LOAD_ONLY_FROM_CACHE)) { + } else if (mLoadFlags & (VALIDATE_NEVER | nsICachingChannel::LOAD_ONLY_FROM_CACHE)) { *aFetchCacheMode = nsIHttpChannelInternal::FETCH_CACHE_MODE_ONLY_IF_CACHED; - } else if (mLoadFlags & LOAD_FROM_CACHE) { + } else if (mLoadFlags & VALIDATE_NEVER) { *aFetchCacheMode = nsIHttpChannelInternal::FETCH_CACHE_MODE_FORCE_CACHE; } else { *aFetchCacheMode = nsIHttpChannelInternal::FETCH_CACHE_MODE_DEFAULT; @@ -2518,7 +2518,7 @@ HttpBaseChannel::SetFetchCacheMode(uint32_t aFetchCacheMode) break; case nsIHttpChannelInternal::FETCH_CACHE_MODE_FORCE_CACHE: // force-cache means don't validate unless if the response would vary. - mLoadFlags |= LOAD_FROM_CACHE; + mLoadFlags |= VALIDATE_NEVER; break; case nsIHttpChannelInternal::FETCH_CACHE_MODE_ONLY_IF_CACHED: // only-if-cached means only from cache, no network, no validation, generate @@ -2527,7 +2527,7 @@ HttpBaseChannel::SetFetchCacheMode(uint32_t aFetchCacheMode) // the user has things in their cache without any network traffic side // effects) are addressed in the Request constructor which enforces/requires // same-origin request mode. - mLoadFlags |= LOAD_FROM_CACHE | nsICachingChannel::LOAD_ONLY_FROM_CACHE; + mLoadFlags |= VALIDATE_NEVER | nsICachingChannel::LOAD_ONLY_FROM_CACHE; break; } diff --git a/netwerk/protocol/http/HttpChannelParent.cpp b/netwerk/protocol/http/HttpChannelParent.cpp index fe076a237..5f0859f28 100644 --- a/netwerk/protocol/http/HttpChannelParent.cpp +++ b/netwerk/protocol/http/HttpChannelParent.cpp @@ -1772,8 +1772,8 @@ HttpChannelParent::UpdateAndSerializeSecurityInfo(nsACString& aSerializedSecurit bool HttpChannelParent::DoSendDeleteSelf() { - bool rv = SendDeleteSelf(); mIPCClosed = true; + bool rv = SendDeleteSelf(); return rv; } diff --git a/netwerk/protocol/http/HttpChannelParent.h b/netwerk/protocol/http/HttpChannelParent.h index 51fae5a82..a3b377d49 100644 --- a/netwerk/protocol/http/HttpChannelParent.h +++ b/netwerk/protocol/http/HttpChannelParent.h @@ -209,7 +209,7 @@ private: RefPtr<nsHttpChannel> mChannel; nsCOMPtr<nsICacheEntry> mCacheEntry; nsCOMPtr<nsIAssociatedContentSecurity> mAssociatedContentSecurity; - bool mIPCClosed; // PHttpChannel actor has been Closed() + Atomic<bool> mIPCClosed; // PHttpChannel actor has been Closed() nsCOMPtr<nsIChannel> mRedirectChannel; nsCOMPtr<nsIAsyncVerifyRedirectCallback> mRedirectCallback; |