summaryrefslogtreecommitdiff
path: root/netwerk
diff options
context:
space:
mode:
authorNicholas Hurley <hurley@mozilla.com>2018-02-02 11:03:08 -0800
committerwolfbeast <mcwerewolf@gmail.com>2018-03-14 10:59:09 +0100
commit756fb3e1455cd903f952ded1c45f86e3527875ed (patch)
tree809988a6da3f108ee55472b4fb8597d13c560f30 /netwerk
parente749d23a34ff04c492bcf729e01ed1a0292408f1 (diff)
downloaduxp-756fb3e1455cd903f952ded1c45f86e3527875ed.tar.gz
Bug 1416529. r=mcmanus, a=ritu
MozReview-Commit-ID: CD1l5vLB4yy --HG-- extra : rebase_source : d74f8ca96dab4e0d25d79948fcddbf8dab98bb36
Diffstat (limited to 'netwerk')
-rw-r--r--netwerk/protocol/http/Http2Session.cpp18
-rw-r--r--netwerk/protocol/http/Http2Stream.cpp14
-rw-r--r--netwerk/protocol/http/Http2Stream.h1
3 files changed, 24 insertions, 9 deletions
diff --git a/netwerk/protocol/http/Http2Session.cpp b/netwerk/protocol/http/Http2Session.cpp
index 55ddbe9087..4f350af83b 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 f49c1f138e..7a8f968550 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 968461ee4a..8783eefeda 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; }