| 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 2583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2594 return; | 2594 return; |
| 2595 } | 2595 } |
| 2596 | 2596 |
| 2597 streams_pushed_count_++; | 2597 streams_pushed_count_++; |
| 2598 | 2598 |
| 2599 // TODO(mbelshe): DCHECK that this is a GET method? | 2599 // TODO(mbelshe): DCHECK that this is a GET method? |
| 2600 | 2600 |
| 2601 // Verify that the response had a URL for us. | 2601 // Verify that the response had a URL for us. |
| 2602 GURL gurl = GetUrlFromHeaderBlock(headers); | 2602 GURL gurl = GetUrlFromHeaderBlock(headers); |
| 2603 if (!gurl.is_valid()) { | 2603 if (!gurl.is_valid()) { |
| 2604 EnqueueResetStreamFrame(stream_id, request_priority, | 2604 EnqueueResetStreamFrame( |
| 2605 ERROR_CODE_PROTOCOL_ERROR, | 2605 stream_id, request_priority, ERROR_CODE_PROTOCOL_ERROR, |
| 2606 "Pushed stream url was invalid: " + gurl.spec()); | 2606 "Pushed stream url was invalid: " + gurl.possibly_invalid_spec()); |
| 2607 return; | 2607 return; |
| 2608 } | 2608 } |
| 2609 | 2609 |
| 2610 // Verify we have a valid stream association. | 2610 // Verify we have a valid stream association. |
| 2611 ActiveStreamMap::iterator associated_it = | 2611 ActiveStreamMap::iterator associated_it = |
| 2612 active_streams_.find(associated_stream_id); | 2612 active_streams_.find(associated_stream_id); |
| 2613 if (associated_it == active_streams_.end()) { | 2613 if (associated_it == active_streams_.end()) { |
| 2614 EnqueueResetStreamFrame( | 2614 EnqueueResetStreamFrame( |
| 2615 stream_id, request_priority, ERROR_CODE_STREAM_CLOSED, | 2615 stream_id, request_priority, ERROR_CODE_STREAM_CLOSED, |
| 2616 base::StringPrintf("Received push for inactive associated stream %d", | 2616 base::StringPrintf("Received push for inactive associated stream %d", |
| (...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3139 if (!queue->empty()) { | 3139 if (!queue->empty()) { |
| 3140 SpdyStreamId stream_id = queue->front(); | 3140 SpdyStreamId stream_id = queue->front(); |
| 3141 queue->pop_front(); | 3141 queue->pop_front(); |
| 3142 return stream_id; | 3142 return stream_id; |
| 3143 } | 3143 } |
| 3144 } | 3144 } |
| 3145 return 0; | 3145 return 0; |
| 3146 } | 3146 } |
| 3147 | 3147 |
| 3148 } // namespace net | 3148 } // namespace net |
| OLD | NEW |