Chromium Code Reviews| 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 2677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2688 | 2688 |
| 2689 net_log_.AddEvent( | 2689 net_log_.AddEvent( |
| 2690 NetLogEventType::HTTP2_SESSION_RECV_GOAWAY, | 2690 NetLogEventType::HTTP2_SESSION_RECV_GOAWAY, |
| 2691 base::Bind(&NetLogSpdyRecvGoAwayCallback, last_accepted_stream_id, | 2691 base::Bind(&NetLogSpdyRecvGoAwayCallback, last_accepted_stream_id, |
| 2692 active_streams_.size(), unclaimed_pushed_streams_.size(), | 2692 active_streams_.size(), unclaimed_pushed_streams_.size(), |
| 2693 error_code, debug_data)); | 2693 error_code, debug_data)); |
| 2694 MakeUnavailable(); | 2694 MakeUnavailable(); |
| 2695 if (error_code == ERROR_CODE_HTTP_1_1_REQUIRED) { | 2695 if (error_code == ERROR_CODE_HTTP_1_1_REQUIRED) { |
| 2696 // TODO(bnc): Record histogram with number of open streams capped at 50. | 2696 // TODO(bnc): Record histogram with number of open streams capped at 50. |
| 2697 DoDrainSession(ERR_HTTP_1_1_REQUIRED, "HTTP_1_1_REQUIRED for stream."); | 2697 DoDrainSession(ERR_HTTP_1_1_REQUIRED, "HTTP_1_1_REQUIRED for stream."); |
| 2698 } else if (error_code == ERROR_CODE_NO_ERROR) { | |
|
Zhongyi Shi
2017/04/19 00:40:28
I am not familiar with SPDY code, but according to
Bence
2017/04/19 12:12:15
Excellent questions.
In StartGoingAway() there is
Zhongyi Shi
2017/04/19 17:19:18
Ah, I see, thanks for the clarification and code w
| |
| 2699 StartGoingAway(last_accepted_stream_id, ERR_SPDY_SERVER_REFUSED_STREAM); | |
| 2698 } else { | 2700 } else { |
| 2699 StartGoingAway(last_accepted_stream_id, ERR_ABORTED); | 2701 StartGoingAway(last_accepted_stream_id, ERR_ABORTED); |
| 2700 } | 2702 } |
| 2701 // This is to handle the case when we already don't have any active | 2703 // This is to handle the case when we already don't have any active |
| 2702 // streams (i.e., StartGoingAway() did nothing). Otherwise, we have | 2704 // streams (i.e., StartGoingAway() did nothing). Otherwise, we have |
| 2703 // active streams and so the last one being closed will finish the | 2705 // active streams and so the last one being closed will finish the |
| 2704 // going away process (see DeleteStream()). | 2706 // going away process (see DeleteStream()). |
| 2705 MaybeFinishGoingAway(); | 2707 MaybeFinishGoingAway(); |
| 2706 } | 2708 } |
| 2707 | 2709 |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3191 if (!queue->empty()) { | 3193 if (!queue->empty()) { |
| 3192 SpdyStreamId stream_id = queue->front(); | 3194 SpdyStreamId stream_id = queue->front(); |
| 3193 queue->pop_front(); | 3195 queue->pop_front(); |
| 3194 return stream_id; | 3196 return stream_id; |
| 3195 } | 3197 } |
| 3196 } | 3198 } |
| 3197 return 0; | 3199 return 0; |
| 3198 } | 3200 } |
| 3199 | 3201 |
| 3200 } // namespace net | 3202 } // namespace net |
| OLD | NEW |