diff --git a/netwerk/protocol/http/Http2Session.cpp b/netwerk/protocol/http/Http2Session.cpp index 6e9dbcb2ab8c..0d849b87e303 100644 --- a/netwerk/protocol/http/Http2Session.cpp +++ b/netwerk/protocol/http/Http2Session.cpp @@ -384,6 +384,17 @@ Http2Session::AddStream(nsAHttpTransaction *aHttpTransaction, mConnection = aHttpTransaction->Connection(); } + if (mClosed || mShouldGoAway) { + nsHttpTransaction *trans = aHttpTransaction->QueryHttpTransaction(); + if (trans && !trans->GetPushedStream()) { + LOG3(("Http2Session::AddStream %p atrans=%p trans=%p session unusable - resched.\n", + this, aHttpTransaction, trans)); + aHttpTransaction->SetConnection(nullptr); + gHttpHandler->InitiateTransaction(trans, trans->Priority()); + return true; + } + } + aHttpTransaction->SetConnection(this); if (aUseTunnel) { diff --git a/netwerk/protocol/http/SpdySession31.cpp b/netwerk/protocol/http/SpdySession31.cpp index 59399674d543..6ddce2b574de 100644 --- a/netwerk/protocol/http/SpdySession31.cpp +++ b/netwerk/protocol/http/SpdySession31.cpp @@ -338,6 +338,17 @@ SpdySession31::AddStream(nsAHttpTransaction *aHttpTransaction, mConnection = aHttpTransaction->Connection(); } + if (mClosed || mShouldGoAway) { + nsHttpTransaction *trans = aHttpTransaction->QueryHttpTransaction(); + if (trans && !trans->GetPushedStream()) { + LOG3(("SpdySession31::AddStream %p atrans=%p trans=%p session unusable - resched.\n", + this, aHttpTransaction, trans)); + aHttpTransaction->SetConnection(nullptr); + gHttpHandler->InitiateTransaction(trans, trans->Priority()); + return true; + } + } + aHttpTransaction->SetConnection(this); if (aUseTunnel) { diff --git a/netwerk/protocol/http/nsHttpConnectionMgr.cpp b/netwerk/protocol/http/nsHttpConnectionMgr.cpp index c2513c457a89..8a9e582ff462 100644 --- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp +++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp @@ -1861,6 +1861,8 @@ nsHttpConnectionMgr::ProcessNewTransaction(nsHttpTransaction *trans) Http2PushedStream *pushedStream = trans->GetPushedStream(); if (pushedStream) { + LOG((" ProcessNewTransaction %p tied to h2 session push %p\n", + trans, pushedStream->Session())); return pushedStream->Session()-> AddStream(trans, trans->Priority(), false, nullptr) ? NS_OK : NS_ERROR_UNEXPECTED;