Implement a threadsafe & revised version of http2PushedStream.

This commit is contained in:
wolfbeast 2019-07-18 17:52:46 +02:00 committed by Roy Tam
commit 28e15ed590
9 changed files with 144 additions and 32 deletions

View file

@ -1819,13 +1819,18 @@ nsHttpConnectionMgr::ProcessNewTransaction(nsHttpTransaction *trans)
trans->SetPendingTime();
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;
RefPtr<Http2PushedStreamWrapper> pushedStreamWrapper =
trans->GetPushedStream();
if (pushedStreamWrapper) {
Http2PushedStream* pushedStream = pushedStreamWrapper->GetStream();
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;
}
}
nsresult rv = NS_OK;