MozReview-Commit-ID: CD1l5vLB4yy
This commit is contained in:
Nicholas Hurley 2018-02-02 11:03:08 -08:00
Родитель 300c9ec2f3
Коммит 036c8b605d
3 изменённых файлов: 24 добавлений и 9 удалений

Просмотреть файл

@ -1136,6 +1136,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;
@ -1146,15 +1155,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)

Просмотреть файл

@ -112,12 +112,22 @@ Http2Stream::Http2Stream(nsAHttpTransaction *httpTransaction,
Http2Stream::~Http2Stream()
{
ClearPushSource();
ClearTransactionsBlockedOnTunnel();
mStreamID = Http2Session::kDeadStreamID;
LOG3(("Http2Stream::~Http2Stream %p", this));
}
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
@ -1137,6 +1147,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);
}

Просмотреть файл

@ -56,6 +56,7 @@ public:
uint32_t StreamID() { return mStreamID; }
Http2PushedStream *PushSource() { return mPushSource; }
void ClearPushSource();
stateType HTTPState() { return mState; }
void SetHTTPState(stateType val) { mState = val; }