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

@ -442,12 +442,14 @@ Http2Stream::ParseHttpRequestHeaders(const char *buf,
requestContext->GetSpdyPushCache(&cache);
}
RefPtr<Http2PushedStreamWrapper> pushedStreamWrapper;
Http2PushedStream *pushedStream = nullptr;
// If a push stream is attached to the transaction via onPush, match only with that
// one. This occurs when a push was made with in conjunction with a nsIHttpPushListener
nsHttpTransaction *trans = mTransaction->QueryHttpTransaction();
if (trans && (pushedStream = trans->TakePushedStream())) {
if (trans && (pushedStreamWrapper = trans->TakePushedStream()) &&
(pushedStream = pushedStreamWrapper->GetStream())) {
if (pushedStream->mSession == mSession) {
LOG3(("Pushed Stream match based on OnPush correlation %p", pushedStream));
} else {