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/quic/core/quic_session.h" | 5 #include "net/quic/core/quic_session.h" |
6 | 6 |
7 #include <cstdint> | 7 #include <cstdint> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "net/quic/core/quic_connection.h" | 10 #include "net/quic/core/quic_connection.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
88 } | 88 } |
89 | 89 |
90 void QuicSession::OnRstStream(const QuicRstStreamFrame& frame) { | 90 void QuicSession::OnRstStream(const QuicRstStreamFrame& frame) { |
91 if (QuicContainsKey(static_stream_map_, frame.stream_id)) { | 91 if (QuicContainsKey(static_stream_map_, frame.stream_id)) { |
92 connection()->CloseConnection( | 92 connection()->CloseConnection( |
93 QUIC_INVALID_STREAM_ID, "Attempt to reset a static stream", | 93 QUIC_INVALID_STREAM_ID, "Attempt to reset a static stream", |
94 ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); | 94 ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); |
95 return; | 95 return; |
96 } | 96 } |
97 | 97 |
98 if (visitor_) | |
99 visitor_->OnRstStreamReceived(frame); | |
Ryan Hamilton
2017/02/22 23:12:33
I think this should have {}s since it's shared cod
Zhongyi Shi
2017/02/23 00:19:46
Sync'ed after the internal code landed. BTW, I not
Ryan Hamilton
2017/02/23 00:27:00
No... (Though we might want to do that at some poi
| |
100 | |
98 QuicStream* stream = GetOrCreateDynamicStream(frame.stream_id); | 101 QuicStream* stream = GetOrCreateDynamicStream(frame.stream_id); |
99 if (!stream) { | 102 if (!stream) { |
100 HandleRstOnValidNonexistentStream(frame); | 103 HandleRstOnValidNonexistentStream(frame); |
101 return; // Errors are handled by GetOrCreateStream. | 104 return; // Errors are handled by GetOrCreateStream. |
102 } | 105 } |
103 | 106 |
104 stream->OnStreamReset(frame); | 107 stream->OnStreamReset(frame); |
105 } | 108 } |
106 | 109 |
107 void QuicSession::OnGoAway(const QuicGoAwayFrame& frame) { | 110 void QuicSession::OnGoAway(const QuicGoAwayFrame& frame) { |
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
866 | 869 |
867 size_t QuicSession::MaxAvailableStreams() const { | 870 size_t QuicSession::MaxAvailableStreams() const { |
868 return max_open_incoming_streams_ * kMaxAvailableStreamsMultiplier; | 871 return max_open_incoming_streams_ * kMaxAvailableStreamsMultiplier; |
869 } | 872 } |
870 | 873 |
871 bool QuicSession::IsIncomingStream(QuicStreamId id) const { | 874 bool QuicSession::IsIncomingStream(QuicStreamId id) const { |
872 return id % 2 != next_outgoing_stream_id_ % 2; | 875 return id % 2 != next_outgoing_stream_id_ % 2; |
873 } | 876 } |
874 | 877 |
875 } // namespace net | 878 } // namespace net |
OLD | NEW |