mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1030203 - Send PROTOCOL_ERROR when receiving PUSH_PROMISE with push disabled. r=mcmanus
This commit is contained in:
parent
05aa543b2f
commit
9dddba61a2
@ -98,6 +98,8 @@ Http2Session::Http2Session(nsISocketTransport *aSocketTransport)
|
|||||||
, mOutputQueueSent(0)
|
, mOutputQueueSent(0)
|
||||||
, mLastReadEpoch(PR_IntervalNow())
|
, mLastReadEpoch(PR_IntervalNow())
|
||||||
, mPingSentEpoch(0)
|
, mPingSentEpoch(0)
|
||||||
|
, mWaitingForSettingsAck(false)
|
||||||
|
, mGoAwayOnPush(false)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
|
MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
|
||||||
|
|
||||||
@ -808,6 +810,8 @@ Http2Session::SendHello()
|
|||||||
CopyAsNetwork16(packet + 8 + (6 * numberOfEntries), SETTINGS_TYPE_MAX_CONCURRENT);
|
CopyAsNetwork16(packet + 8 + (6 * numberOfEntries), SETTINGS_TYPE_MAX_CONCURRENT);
|
||||||
// The value portion of the setting pair is already initialized to 0
|
// The value portion of the setting pair is already initialized to 0
|
||||||
numberOfEntries++;
|
numberOfEntries++;
|
||||||
|
|
||||||
|
mWaitingForSettingsAck = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Advertise the Push RWIN for the session, and on each new pull stream
|
// Advertise the Push RWIN for the session, and on each new pull stream
|
||||||
@ -1359,8 +1363,11 @@ Http2Session::RecvSettings(Http2Session *self)
|
|||||||
|
|
||||||
self->ResetDownstreamState();
|
self->ResetDownstreamState();
|
||||||
|
|
||||||
if (!(self->mInputFrameFlags & kFlag_ACK))
|
if (!(self->mInputFrameFlags & kFlag_ACK)) {
|
||||||
self->GenerateSettingsAck();
|
self->GenerateSettingsAck();
|
||||||
|
} else if (self->mWaitingForSettingsAck) {
|
||||||
|
self->mGoAwayOnPush = true;
|
||||||
|
}
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
@ -1444,8 +1451,12 @@ Http2Session::RecvPushPromise(Http2Session *self)
|
|||||||
"mode refused.\n", self));
|
"mode refused.\n", self));
|
||||||
self->GenerateRstStream(REFUSED_STREAM_ERROR, promisedID);
|
self->GenerateRstStream(REFUSED_STREAM_ERROR, promisedID);
|
||||||
} else if (!gHttpHandler->AllowPush()) {
|
} else if (!gHttpHandler->AllowPush()) {
|
||||||
// MAX_CONCURRENT_STREAMS of 0 in settings disabled push
|
// ENABLE_PUSH and MAX_CONCURRENT_STREAMS of 0 in settings disabled push
|
||||||
LOG3(("Http2Session::RecvPushPromise Push Recevied when Disabled\n"));
|
LOG3(("Http2Session::RecvPushPromise Push Recevied when Disabled\n"));
|
||||||
|
if (self->mGoAwayOnPush) {
|
||||||
|
LOG3(("Http2Session::RecvPushPromise sending GOAWAY"));
|
||||||
|
RETURN_SESSION_ERROR(self, PROTOCOL_ERROR);
|
||||||
|
}
|
||||||
self->GenerateRstStream(REFUSED_STREAM_ERROR, promisedID);
|
self->GenerateRstStream(REFUSED_STREAM_ERROR, promisedID);
|
||||||
} else if (!(self->mInputFrameFlags & kFlag_END_PUSH_PROMISE)) {
|
} else if (!(self->mInputFrameFlags & kFlag_END_PUSH_PROMISE)) {
|
||||||
LOG3(("Http2Session::RecvPushPromise no support for multi frame push\n"));
|
LOG3(("Http2Session::RecvPushPromise no support for multi frame push\n"));
|
||||||
|
@ -441,6 +441,13 @@ private:
|
|||||||
// to make sure streams aren't shared across sessions.
|
// to make sure streams aren't shared across sessions.
|
||||||
uint64_t mSerial;
|
uint64_t mSerial;
|
||||||
|
|
||||||
|
// If push is disabled, we want to be able to send PROTOCOL_ERRORs if we
|
||||||
|
// receive a PUSH_PROMISE, but we have to wait for the SETTINGS ACK before
|
||||||
|
// we can actually tell the other end to go away. These help us keep track
|
||||||
|
// of that state so we can behave appropriately.
|
||||||
|
bool mWaitingForSettingsAck;
|
||||||
|
bool mGoAwayOnPush;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// connect tunnels
|
/// connect tunnels
|
||||||
void DispatchOnTunnel(nsAHttpTransaction *, nsIInterfaceRequestor *);
|
void DispatchOnTunnel(nsAHttpTransaction *, nsIInterfaceRequestor *);
|
||||||
|
Loading…
Reference in New Issue
Block a user