OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // TODO(rtenhove) clean up frame buffer size calculations so that we aren't | 5 // TODO(rtenhove) clean up frame buffer size calculations so that we aren't |
6 // constantly adding and subtracting header sizes; this is ugly and error- | 6 // constantly adding and subtracting header sizes; this is ugly and error- |
7 // prone. | 7 // prone. |
8 | 8 |
9 #include "net/spdy/spdy_framer.h" | 9 #include "net/spdy/spdy_framer.h" |
10 | 10 |
(...skipping 1201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1212 reinterpret_cast<SpdyRstStreamControlFrame*>(&control_frame); | 1212 reinterpret_cast<SpdyRstStreamControlFrame*>(&control_frame); |
1213 visitor_->OnRstStream(rst_stream_frame->stream_id(), | 1213 visitor_->OnRstStream(rst_stream_frame->stream_id(), |
1214 rst_stream_frame->status()); | 1214 rst_stream_frame->status()); |
1215 } | 1215 } |
1216 break; | 1216 break; |
1217 case GOAWAY: { | 1217 case GOAWAY: { |
1218 SpdyFrameReader reader(current_frame_buffer_.get(), | 1218 SpdyFrameReader reader(current_frame_buffer_.get(), |
1219 current_frame_len_); | 1219 current_frame_len_); |
1220 reader.Seek(GetControlFrameMinimumSize()); // Skip frame header. | 1220 reader.Seek(GetControlFrameMinimumSize()); // Skip frame header. |
1221 SpdyStreamId last_accepted_stream_id = kInvalidStream; | 1221 SpdyStreamId last_accepted_stream_id = kInvalidStream; |
1222 bool successful_read = reader.ReadUInt32(&last_accepted_stream_id); | 1222 bool successful_read = reader.ReadUInt31(&last_accepted_stream_id); |
1223 DCHECK(successful_read); | 1223 DCHECK(successful_read); |
1224 SpdyGoAwayStatus status = GOAWAY_OK; | 1224 SpdyGoAwayStatus status = GOAWAY_OK; |
1225 if (spdy_version_ >= 3) { | 1225 if (spdy_version_ >= 3) { |
1226 uint32 status_raw = GOAWAY_OK; | 1226 uint32 status_raw = GOAWAY_OK; |
1227 successful_read = reader.ReadUInt32(&status_raw); | 1227 successful_read = reader.ReadUInt32(&status_raw); |
1228 DCHECK(successful_read); | 1228 DCHECK(successful_read); |
1229 if (status_raw > static_cast<uint32>(GOAWAY_INVALID) && | 1229 if (status_raw > static_cast<uint32>(GOAWAY_INVALID) && |
1230 status_raw < static_cast<uint32>(GOAWAY_NUM_STATUS_CODES)) { | 1230 status_raw < static_cast<uint32>(GOAWAY_NUM_STATUS_CODES)) { |
1231 status = static_cast<SpdyGoAwayStatus>(status_raw); | 1231 status = static_cast<SpdyGoAwayStatus>(status_raw); |
1232 } else { | 1232 } else { |
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2071 builder->WriteString(it->first); | 2071 builder->WriteString(it->first); |
2072 builder->WriteString(it->second); | 2072 builder->WriteString(it->second); |
2073 } else { | 2073 } else { |
2074 builder->WriteStringPiece32(it->first); | 2074 builder->WriteStringPiece32(it->first); |
2075 builder->WriteStringPiece32(it->second); | 2075 builder->WriteStringPiece32(it->second); |
2076 } | 2076 } |
2077 } | 2077 } |
2078 } | 2078 } |
2079 | 2079 |
2080 } // namespace net | 2080 } // namespace net |
OLD | NEW |