Bug 1236170 - Make Http2Session::UncompressAndDiscard push-aware. r=mcmanus

--HG--
extra : commitid : 16EiVpkRWzq
extra : rebase_source : 6146a35424871e8de7cc989acb3479b35921a2a9
This commit is contained in:
Nicholas Hurley 2016-01-04 12:17:39 -08:00
Родитель 687256f38d
Коммит af06028314
2 изменённых файлов: 6 добавлений и 6 удалений

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

@ -700,13 +700,13 @@ Http2Session::MaybeDecrementConcurrent(Http2Stream *aStream)
// Need to decompress some data in order to keep the compression
// context correct, but we really don't care what the result is
nsresult
Http2Session::UncompressAndDiscard()
Http2Session::UncompressAndDiscard(bool isPush)
{
nsresult rv;
nsAutoCString trash;
rv = mDecompressor.DecodeHeaderBlock(reinterpret_cast<const uint8_t *>(mDecompressBuffer.BeginReading()),
mDecompressBuffer.Length(), trash, false);
mDecompressBuffer.Length(), trash, isPush);
mDecompressBuffer.Truncate();
if (NS_FAILED(rv)) {
LOG3(("Http2Session::UncompressAndDiscard %p Compression Error\n",
@ -1239,7 +1239,7 @@ Http2Session::RecvHeaders(Http2Session *self)
self->mInputFrameDataSize - paddingControlBytes - priorityLen - paddingLength);
if (self->mInputFrameFlags & kFlag_END_HEADERS) {
rv = self->UncompressAndDiscard();
rv = self->UncompressAndDiscard(false);
if (NS_FAILED(rv)) {
LOG3(("Http2Session::RecvHeaders uncompress failed\n"));
// this is fatal to the session
@ -1300,7 +1300,7 @@ Http2Session::ResponseHeadersComplete()
if (mInputFrameDataStream->AllHeadersReceived()) {
LOG3(("Http2Session::ResponseHeadersComplete extra headers"));
MOZ_ASSERT(mInputFrameFlags & kFlag_END_STREAM);
nsresult rv = UncompressAndDiscard();
nsresult rv = UncompressAndDiscard(false);
if (NS_FAILED(rv)) {
LOG3(("Http2Session::ResponseHeadersComplete extra uncompress failed\n"));
return rv;
@ -1649,7 +1649,7 @@ Http2Session::RecvPushPromise(Http2Session *self)
self->mDecompressBuffer.Append(&self->mInputFrameBuffer[kFrameHeaderBytes + paddingControlBytes + promiseLen],
self->mInputFrameDataSize - paddingControlBytes - promiseLen - paddingLength);
if (self->mInputFrameFlags & kFlag_END_PUSH_PROMISE) {
rv = self->UncompressAndDiscard();
rv = self->UncompressAndDiscard(true);
if (NS_FAILED(rv)) {
LOG3(("Http2Session::RecvPushPromise uncompress failed\n"));
self->mGoAwayReason = COMPRESSION_ERROR;

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

@ -255,7 +255,7 @@ private:
void ChangeDownstreamState(enum internalStateType);
void ResetDownstreamState();
nsresult ReadyToProcessDataFrame(enum internalStateType);
nsresult UncompressAndDiscard();
nsresult UncompressAndDiscard(bool);
void GeneratePing(bool);
void GenerateSettingsAck();
void GeneratePriority(uint32_t, uint8_t);