diff options
Diffstat (limited to 'net/spdy/spdy_framer.cc')
-rw-r--r-- | net/spdy/spdy_framer.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/net/spdy/spdy_framer.cc b/net/spdy/spdy_framer.cc index 7a0d152..bb5d0fe 100644 --- a/net/spdy/spdy_framer.cc +++ b/net/spdy/spdy_framer.cc @@ -304,11 +304,6 @@ void SpdyFramer::ProcessControlFrameHeader() { SpdySettingsControlFrame::size() - SpdyControlFrame::size()) set_error(SPDY_INVALID_CONTROL_FRAME); break; - case WINDOW_UPDATE: - if (current_control_frame.length() != - SpdyWindowUpdateControlFrame::size() - SpdyFrame::size()) - set_error(SPDY_INVALID_CONTROL_FRAME); - break; default: LOG(WARNING) << "Valid spdy control frame with unknown type: " << current_control_frame.type(); @@ -317,6 +312,12 @@ void SpdyFramer::ProcessControlFrameHeader() { break; } + // We only support version 1 of this protocol. + if (current_control_frame.version() != kSpdyProtocolVersion) { + set_error(SPDY_UNSUPPORTED_VERSION); + return; + } + remaining_control_payload_ = current_control_frame.length(); if (remaining_control_payload_ > kControlFrameBufferMaxSize) { set_error(SPDY_CONTROL_PAYLOAD_TOO_LARGE); @@ -591,7 +592,7 @@ SpdyWindowUpdateControlFrame* SpdyFramer::CreateWindowUpdate( DCHECK_GT(stream_id, 0u); DCHECK_EQ(0u, stream_id & ~kStreamIdMask); DCHECK_GT(delta_window_size, 0u); - DCHECK_LT(delta_window_size, 0x80000000u); // 2^31 + DCHECK_LE(delta_window_size, 0x80000000u); // 2^31 SpdyFrameBuilder frame; frame.WriteUInt16(kControlFlagMask | kSpdyProtocolVersion); |