diff options
Diffstat (limited to 'net/spdy/spdy_frame_reader.cc')
-rw-r--r-- | net/spdy/spdy_frame_reader.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/net/spdy/spdy_frame_reader.cc b/net/spdy/spdy_frame_reader.cc index a5919a6..0ab1f2f 100644 --- a/net/spdy/spdy_frame_reader.cc +++ b/net/spdy/spdy_frame_reader.cc @@ -75,6 +75,24 @@ bool SpdyFrameReader::ReadUInt31(uint32* result) { return success; } +bool SpdyFrameReader::ReadUInt24(uint32* result) { + // Make sure that we have the whole uint24. + if (!CanRead(3)) { + OnFailure(); + return false; + } + + // Read into result. + *result = 0; + memcpy(reinterpret_cast<char*>(result) + 1, data_ + ofs_, 3); + *result = ntohl(*result); + + // Iterate. + ofs_ += 3; + + return true; +} + bool SpdyFrameReader::ReadStringPiece16(base::StringPiece* result) { // Read resultant length. uint16 result_len; |