Chromium Code Reviews| Index: net/spdy/spdy_framer.cc |
| diff --git a/net/spdy/spdy_framer.cc b/net/spdy/spdy_framer.cc |
| index c828d168bab1093812664086e5807dbd9779992a..c0b359946b7174ee9b7eec7e0f5c43e05beff5d5 100644 |
| --- a/net/spdy/spdy_framer.cc |
| +++ b/net/spdy/spdy_framer.cc |
| @@ -875,7 +875,7 @@ void SpdyFramer::ProcessControlFrameHeader(uint16 control_frame_type_field) { |
| // plus a 4-byte length field in SPDY3 and below. |
| size_t values_prefix_size = (protocol_version() <= SPDY3 ? 4 : 0); |
| // Size of each key/value pair in bytes. |
| - size_t setting_size = (protocol_version() <= SPDY3 ? 8 : 5); |
| + size_t setting_size = (protocol_version() <= SPDY3 ? 8 : 6); |
|
Ryan Hamilton
2014/06/26 15:43:20
Since this is used in a few places, consider extra
Johnny
2014/06/26 16:19:08
Done.
|
| if (current_frame_length_ < GetSettingsMinimumSize() || |
| (current_frame_length_ - GetControlFrameHeaderSize()) |
| % setting_size != values_prefix_size) { |
| @@ -1605,7 +1605,7 @@ size_t SpdyFramer::ProcessSettingsFramePayload(const char* data, |
| size_t unprocessed_bytes = std::min(data_len, remaining_data_length_); |
| size_t processed_bytes = 0; |
| - size_t setting_size = protocol_version() <= SPDY3 ? 8 : 5; |
| + size_t setting_size = protocol_version() <= SPDY3 ? 8 : 6; |
| // Loop over our incoming data. |
| while (unprocessed_bytes > 0) { |
| @@ -1699,8 +1699,8 @@ bool SpdyFramer::ProcessSetting(const char* data) { |
| flags = id_and_flags.flags(); |
| value = ntohl(*(reinterpret_cast<const uint32*>(data + 4))); |
| } else { |
| - id_field = *(reinterpret_cast<const uint8*>(data)); |
| - value = ntohl(*(reinterpret_cast<const uint32*>(data + 1))); |
| + id_field = ntohs(*(reinterpret_cast<const uint16*>(data))); |
| + value = ntohl(*(reinterpret_cast<const uint32*>(data + 2))); |
| } |
| // Validate id. |
| @@ -2451,7 +2451,7 @@ SpdySerializedFrame* SpdyFramer::SerializeSettings( |
| } |
| const SpdySettingsIR::ValueMap* values = &(settings.values()); |
| - size_t setting_size = (protocol_version() <= SPDY3 ? 8 : 5); |
| + size_t setting_size = (protocol_version() <= SPDY3 ? 8 : 6); |
| // Size, in bytes, of this SETTINGS frame. |
| const size_t size = GetSettingsMinimumSize() + |
| (values->size() * setting_size); |
| @@ -2488,8 +2488,8 @@ SpdySerializedFrame* SpdyFramer::SerializeSettings( |
| uint32 id_and_flags_wire = flags_and_id.GetWireFormat(protocol_version()); |
| builder.WriteBytes(&id_and_flags_wire, 4); |
| } else { |
| - builder.WriteUInt8(SpdyConstants::SerializeSettingId(protocol_version(), |
| - it->first)); |
| + builder.WriteUInt16(SpdyConstants::SerializeSettingId(protocol_version(), |
| + it->first)); |
| } |
| builder.WriteUInt32(it->second.value); |
| } |