| 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 2573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2584 return; | 2584 return; |
| 2585 } | 2585 } |
| 2586 | 2586 |
| 2587 streams_pushed_count_++; | 2587 streams_pushed_count_++; |
| 2588 | 2588 |
| 2589 // TODO(mbelshe): DCHECK that this is a GET method? | 2589 // TODO(mbelshe): DCHECK that this is a GET method? |
| 2590 | 2590 |
| 2591 // Verify that the response had a URL for us. | 2591 // Verify that the response had a URL for us. |
| 2592 GURL gurl = GetUrlFromHeaderBlock(headers); | 2592 GURL gurl = GetUrlFromHeaderBlock(headers); |
| 2593 if (!gurl.is_valid()) { | 2593 if (!gurl.is_valid()) { |
| 2594 EnqueueResetStreamFrame(stream_id, request_priority, | 2594 EnqueueResetStreamFrame( |
| 2595 ERROR_CODE_PROTOCOL_ERROR, | 2595 stream_id, request_priority, ERROR_CODE_PROTOCOL_ERROR, |
| 2596 "Pushed stream url was invalid: " + gurl.spec()); | 2596 "Pushed stream url was invalid: " + gurl.possibly_invalid_spec()); |
| 2597 return; | 2597 return; |
| 2598 } | 2598 } |
| 2599 | 2599 |
| 2600 // Verify we have a valid stream association. | 2600 // Verify we have a valid stream association. |
| 2601 ActiveStreamMap::iterator associated_it = | 2601 ActiveStreamMap::iterator associated_it = |
| 2602 active_streams_.find(associated_stream_id); | 2602 active_streams_.find(associated_stream_id); |
| 2603 if (associated_it == active_streams_.end()) { | 2603 if (associated_it == active_streams_.end()) { |
| 2604 EnqueueResetStreamFrame( | 2604 EnqueueResetStreamFrame( |
| 2605 stream_id, request_priority, ERROR_CODE_STREAM_CLOSED, | 2605 stream_id, request_priority, ERROR_CODE_STREAM_CLOSED, |
| 2606 base::StringPrintf("Received push for inactive associated stream %d", | 2606 base::StringPrintf("Received push for inactive associated stream %d", |
| (...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3129 if (!queue->empty()) { | 3129 if (!queue->empty()) { |
| 3130 SpdyStreamId stream_id = queue->front(); | 3130 SpdyStreamId stream_id = queue->front(); |
| 3131 queue->pop_front(); | 3131 queue->pop_front(); |
| 3132 return stream_id; | 3132 return stream_id; |
| 3133 } | 3133 } |
| 3134 } | 3134 } |
| 3135 return 0; | 3135 return 0; |
| 3136 } | 3136 } |
| 3137 | 3137 |
| 3138 } // namespace net | 3138 } // namespace net |
| OLD | NEW |