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 #include "net/spdy/spdy_session.h" | 5 #include "net/spdy/spdy_session.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <map> | 9 #include <map> |
10 #include <utility> | 10 #include <utility> |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 case SpdyFramer::SPDY_RST_STREAM_FRAME_CORRUPT: | 355 case SpdyFramer::SPDY_RST_STREAM_FRAME_CORRUPT: |
356 return SPDY_ERROR_RST_STREAM_FRAME_CORRUPT; | 356 return SPDY_ERROR_RST_STREAM_FRAME_CORRUPT; |
357 case SpdyFramer::SPDY_INVALID_PADDING: | 357 case SpdyFramer::SPDY_INVALID_PADDING: |
358 return SPDY_ERROR_INVALID_PADDING; | 358 return SPDY_ERROR_INVALID_PADDING; |
359 case SpdyFramer::SPDY_INVALID_DATA_FRAME_FLAGS: | 359 case SpdyFramer::SPDY_INVALID_DATA_FRAME_FLAGS: |
360 return SPDY_ERROR_INVALID_DATA_FRAME_FLAGS; | 360 return SPDY_ERROR_INVALID_DATA_FRAME_FLAGS; |
361 case SpdyFramer::SPDY_INVALID_CONTROL_FRAME_FLAGS: | 361 case SpdyFramer::SPDY_INVALID_CONTROL_FRAME_FLAGS: |
362 return SPDY_ERROR_INVALID_CONTROL_FRAME_FLAGS; | 362 return SPDY_ERROR_INVALID_CONTROL_FRAME_FLAGS; |
363 case SpdyFramer::SPDY_UNEXPECTED_FRAME: | 363 case SpdyFramer::SPDY_UNEXPECTED_FRAME: |
364 return SPDY_ERROR_UNEXPECTED_FRAME; | 364 return SPDY_ERROR_UNEXPECTED_FRAME; |
| 365 case SpdyFramer::SPDY_INTERNAL_FRAMER_ERROR: |
| 366 return SPDY_ERROR_INTERNAL_FRAMER_ERROR; |
365 case SpdyFramer::SPDY_INVALID_CONTROL_FRAME_SIZE: | 367 case SpdyFramer::SPDY_INVALID_CONTROL_FRAME_SIZE: |
366 return SPDY_ERROR_INVALID_CONTROL_FRAME_SIZE; | 368 return SPDY_ERROR_INVALID_CONTROL_FRAME_SIZE; |
367 case SpdyFramer::SPDY_INVALID_STREAM_ID: | 369 case SpdyFramer::SPDY_INVALID_STREAM_ID: |
368 return SPDY_ERROR_INVALID_STREAM_ID; | 370 return SPDY_ERROR_INVALID_STREAM_ID; |
369 default: | 371 default: |
370 NOTREACHED(); | 372 NOTREACHED(); |
371 return static_cast<SpdyProtocolErrorDetails>(-1); | 373 return static_cast<SpdyProtocolErrorDetails>(-1); |
372 } | 374 } |
373 } | 375 } |
374 | 376 |
(...skipping 18 matching lines...) Expand all Loading... |
393 case SpdyFramer::SPDY_RST_STREAM_FRAME_CORRUPT: | 395 case SpdyFramer::SPDY_RST_STREAM_FRAME_CORRUPT: |
394 return ERR_SPDY_PROTOCOL_ERROR; | 396 return ERR_SPDY_PROTOCOL_ERROR; |
395 case SpdyFramer::SPDY_INVALID_PADDING: | 397 case SpdyFramer::SPDY_INVALID_PADDING: |
396 return ERR_SPDY_PROTOCOL_ERROR; | 398 return ERR_SPDY_PROTOCOL_ERROR; |
397 case SpdyFramer::SPDY_INVALID_DATA_FRAME_FLAGS: | 399 case SpdyFramer::SPDY_INVALID_DATA_FRAME_FLAGS: |
398 return ERR_SPDY_PROTOCOL_ERROR; | 400 return ERR_SPDY_PROTOCOL_ERROR; |
399 case SpdyFramer::SPDY_INVALID_CONTROL_FRAME_FLAGS: | 401 case SpdyFramer::SPDY_INVALID_CONTROL_FRAME_FLAGS: |
400 return ERR_SPDY_PROTOCOL_ERROR; | 402 return ERR_SPDY_PROTOCOL_ERROR; |
401 case SpdyFramer::SPDY_UNEXPECTED_FRAME: | 403 case SpdyFramer::SPDY_UNEXPECTED_FRAME: |
402 return ERR_SPDY_PROTOCOL_ERROR; | 404 return ERR_SPDY_PROTOCOL_ERROR; |
| 405 case SpdyFramer::SPDY_INTERNAL_FRAMER_ERROR: |
| 406 return ERR_SPDY_PROTOCOL_ERROR; |
403 case SpdyFramer::SPDY_INVALID_CONTROL_FRAME_SIZE: | 407 case SpdyFramer::SPDY_INVALID_CONTROL_FRAME_SIZE: |
404 return ERR_SPDY_FRAME_SIZE_ERROR; | 408 return ERR_SPDY_FRAME_SIZE_ERROR; |
405 case SpdyFramer::SPDY_INVALID_STREAM_ID: | 409 case SpdyFramer::SPDY_INVALID_STREAM_ID: |
406 return ERR_SPDY_PROTOCOL_ERROR; | 410 return ERR_SPDY_PROTOCOL_ERROR; |
407 default: | 411 default: |
408 NOTREACHED(); | 412 NOTREACHED(); |
409 return ERR_SPDY_PROTOCOL_ERROR; | 413 return ERR_SPDY_PROTOCOL_ERROR; |
410 } | 414 } |
411 } | 415 } |
412 | 416 |
(...skipping 1788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2201 // |session_recv_window_size_| does not change. | 2205 // |session_recv_window_size_| does not change. |
2202 DecreaseRecvWindowSize(static_cast<int32_t>(len)); | 2206 DecreaseRecvWindowSize(static_cast<int32_t>(len)); |
2203 IncreaseRecvWindowSize(static_cast<int32_t>(len)); | 2207 IncreaseRecvWindowSize(static_cast<int32_t>(len)); |
2204 | 2208 |
2205 ActiveStreamMap::iterator it = active_streams_.find(stream_id); | 2209 ActiveStreamMap::iterator it = active_streams_.find(stream_id); |
2206 if (it == active_streams_.end()) | 2210 if (it == active_streams_.end()) |
2207 return; | 2211 return; |
2208 it->second.stream->OnPaddingConsumed(len); | 2212 it->second.stream->OnPaddingConsumed(len); |
2209 } | 2213 } |
2210 | 2214 |
2211 SpdyHeadersHandlerInterface* SpdySession::OnHeaderFrameStart( | |
2212 SpdyStreamId stream_id) { | |
2213 LOG(FATAL); | |
2214 return nullptr; | |
2215 } | |
2216 | |
2217 void SpdySession::OnHeaderFrameEnd(SpdyStreamId stream_id, bool end_headers) { | |
2218 LOG(FATAL); | |
2219 } | |
2220 | |
2221 void SpdySession::OnSettings(bool clear_persisted) { | 2215 void SpdySession::OnSettings(bool clear_persisted) { |
2222 CHECK(in_io_loop_); | 2216 CHECK(in_io_loop_); |
2223 | 2217 |
2224 if (clear_persisted) | 2218 if (clear_persisted) |
2225 http_server_properties_->ClearSpdySettings(GetServer()); | 2219 http_server_properties_->ClearSpdySettings(GetServer()); |
2226 | 2220 |
2227 if (net_log_.IsCapturing()) { | 2221 if (net_log_.IsCapturing()) { |
2228 net_log_.AddEvent(NetLog::TYPE_HTTP2_SESSION_RECV_SETTINGS, | 2222 net_log_.AddEvent(NetLog::TYPE_HTTP2_SESSION_RECV_SETTINGS, |
2229 base::Bind(&NetLogSpdySettingsCallback, host_port_pair(), | 2223 base::Bind(&NetLogSpdySettingsCallback, host_port_pair(), |
2230 clear_persisted)); | 2224 clear_persisted)); |
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3347 if (!queue->empty()) { | 3341 if (!queue->empty()) { |
3348 SpdyStreamId stream_id = queue->front(); | 3342 SpdyStreamId stream_id = queue->front(); |
3349 queue->pop_front(); | 3343 queue->pop_front(); |
3350 return stream_id; | 3344 return stream_id; |
3351 } | 3345 } |
3352 } | 3346 } |
3353 return 0; | 3347 return 0; |
3354 } | 3348 } |
3355 | 3349 |
3356 } // namespace net | 3350 } // namespace net |
OLD | NEW |