Bug 958712 part 2/3 - Allow CONTINUATIONs in PUSH_PROMISEs r=mcmanus

--HG--
extra : rebase_source : 1617bd7cd50a0310d2b50418e952f59c56ae5f2a
This commit is contained in:
Nicholas Hurley 2015-01-30 11:35:20 -08:00
Родитель 18fbf37a24
Коммит 881a7bed60
1 изменённых файлов: 11 добавлений и 7 удалений

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

@ -1541,7 +1541,8 @@ Http2Session::RecvSettings(Http2Session *self)
nsresult
Http2Session::RecvPushPromise(Http2Session *self)
{
MOZ_ASSERT(self->mInputFrameType == FRAME_TYPE_PUSH_PROMISE);
MOZ_ASSERT(self->mInputFrameType == FRAME_TYPE_PUSH_PROMISE ||
self->mInputFrameType == FRAME_TYPE_CONTINUATION);
// Find out how much padding this frame has, so we can only extract the real
// header data from the frame.
@ -1625,9 +1626,6 @@ Http2Session::RecvPushPromise(Http2Session *self)
RETURN_SESSION_ERROR(self, PROTOCOL_ERROR);
}
self->GenerateRstStream(REFUSED_STREAM_ERROR, promisedID);
} else if (!(self->mInputFrameFlags & kFlag_END_PUSH_PROMISE)) {
LOG3(("Http2Session::RecvPushPromise no support for multi frame push\n"));
self->GenerateRstStream(REFUSED_STREAM_ERROR, promisedID);
} else if (!associatedStream) {
LOG3(("Http2Session::RecvPushPromise %p lookup associated ID failed.\n", self));
self->GenerateRstStream(PROTOCOL_ERROR, promisedID);
@ -1669,6 +1667,15 @@ Http2Session::RecvPushPromise(Http2Session *self)
return NS_OK;
}
self->mDecompressBuffer.Append(self->mInputFrameBuffer + kFrameHeaderBytes + paddingControlBytes + promiseLen,
self->mInputFrameDataSize - paddingControlBytes - promiseLen - paddingLength);
if (!(self->mInputFrameFlags & kFlag_END_PUSH_PROMISE)) {
LOG3(("Http2Session::RecvPushPromise not finishing processing for multi-frame push\n"));
self->ResetDownstreamState();
return NS_OK;
}
// Create the buffering transaction and push stream
nsRefPtr<Http2PushTransactionBuffer> transactionBuffer =
new Http2PushTransactionBuffer();
@ -1676,9 +1683,6 @@ Http2Session::RecvPushPromise(Http2Session *self)
Http2PushedStream *pushedStream =
new Http2PushedStream(transactionBuffer, self, associatedStream, promisedID);
self->mDecompressBuffer.Append(self->mInputFrameBuffer + kFrameHeaderBytes + paddingControlBytes + promiseLen,
self->mInputFrameDataSize - paddingControlBytes - promiseLen - paddingLength);
rv = pushedStream->ConvertPushHeaders(&self->mDecompressor,
self->mDecompressBuffer,
pushedStream->GetRequestString());