| 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 2447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2458 SpdyHeaderBlock headers) { | 2458 SpdyHeaderBlock headers) { |
| 2459 // Server-initiated streams should have even sequence numbers. | 2459 // Server-initiated streams should have even sequence numbers. |
| 2460 if ((stream_id & 0x1) != 0) { | 2460 if ((stream_id & 0x1) != 0) { |
| 2461 LOG(WARNING) << "Received invalid push stream id " << stream_id; | 2461 LOG(WARNING) << "Received invalid push stream id " << stream_id; |
| 2462 CloseSessionOnError(ERR_SPDY_PROTOCOL_ERROR, "Odd push stream id."); | 2462 CloseSessionOnError(ERR_SPDY_PROTOCOL_ERROR, "Odd push stream id."); |
| 2463 return false; | 2463 return false; |
| 2464 } | 2464 } |
| 2465 | 2465 |
| 2466 // Server-initiated streams must be associated with client-initiated streams. | 2466 // Server-initiated streams must be associated with client-initiated streams. |
| 2467 if ((associated_stream_id & 0x1) != 1) { | 2467 if ((associated_stream_id & 0x1) != 1) { |
| 2468 LOG(WARNING) << "Received invalid associated stream id " << stream_id; | 2468 LOG(WARNING) << "Received push stream id " << stream_id |
| 2469 << " with invalid associated stream id"; |
| 2469 CloseSessionOnError(ERR_SPDY_PROTOCOL_ERROR, "Push on even stream id."); | 2470 CloseSessionOnError(ERR_SPDY_PROTOCOL_ERROR, "Push on even stream id."); |
| 2470 return false; | 2471 return false; |
| 2471 } | 2472 } |
| 2472 | 2473 |
| 2473 if (stream_id <= last_accepted_push_stream_id_) { | 2474 if (stream_id <= last_accepted_push_stream_id_) { |
| 2474 LOG(WARNING) << "Received push stream id lesser or equal to the last " | 2475 LOG(WARNING) << "Received push stream id " << stream_id |
| 2475 << "accepted before " << stream_id; | 2476 << " lesser or equal to the last accepted before"; |
| 2476 CloseSessionOnError( | 2477 CloseSessionOnError( |
| 2477 ERR_SPDY_PROTOCOL_ERROR, | 2478 ERR_SPDY_PROTOCOL_ERROR, |
| 2478 "New push stream id must be greater than the last accepted."); | 2479 "New push stream id must be greater than the last accepted."); |
| 2479 return false; | 2480 return false; |
| 2480 } | 2481 } |
| 2481 | 2482 |
| 2482 if (IsStreamActive(stream_id)) { | 2483 if (IsStreamActive(stream_id)) { |
| 2483 // We should not get here, we'll start going away earlier on | 2484 // We should not get here, we'll start going away earlier on |
| 2484 // |last_seen_push_stream_id_| check. | 2485 // |last_seen_push_stream_id_| check. |
| 2485 LOG(WARNING) << "Received push for active stream " << stream_id; | 2486 LOG(WARNING) << "Received push for active stream " << stream_id; |
| (...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3115 if (!queue->empty()) { | 3116 if (!queue->empty()) { |
| 3116 SpdyStreamId stream_id = queue->front(); | 3117 SpdyStreamId stream_id = queue->front(); |
| 3117 queue->pop_front(); | 3118 queue->pop_front(); |
| 3118 return stream_id; | 3119 return stream_id; |
| 3119 } | 3120 } |
| 3120 } | 3121 } |
| 3121 return 0; | 3122 return 0; |
| 3122 } | 3123 } |
| 3123 | 3124 |
| 3124 } // namespace net | 3125 } // namespace net |
| OLD | NEW |