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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 } | 87 } |
88 | 88 |
89 void QuicSession::OnRstStream(const QuicRstStreamFrame& frame) { | 89 void QuicSession::OnRstStream(const QuicRstStreamFrame& frame) { |
90 if (QuicContainsKey(static_stream_map_, frame.stream_id)) { | 90 if (QuicContainsKey(static_stream_map_, frame.stream_id)) { |
91 connection()->CloseConnection( | 91 connection()->CloseConnection( |
92 QUIC_INVALID_STREAM_ID, "Attempt to reset a static stream", | 92 QUIC_INVALID_STREAM_ID, "Attempt to reset a static stream", |
93 ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); | 93 ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); |
94 return; | 94 return; |
95 } | 95 } |
96 | 96 |
| 97 if (visitor_) { |
| 98 visitor_->OnRstStreamReceived(frame); |
| 99 } |
| 100 |
97 QuicStream* stream = GetOrCreateDynamicStream(frame.stream_id); | 101 QuicStream* stream = GetOrCreateDynamicStream(frame.stream_id); |
98 if (!stream) { | 102 if (!stream) { |
99 HandleRstOnValidNonexistentStream(frame); | 103 HandleRstOnValidNonexistentStream(frame); |
100 return; // Errors are handled by GetOrCreateStream. | 104 return; // Errors are handled by GetOrCreateStream. |
101 } | 105 } |
102 | 106 |
103 stream->OnStreamReset(frame); | 107 stream->OnStreamReset(frame); |
104 } | 108 } |
105 | 109 |
106 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... |
865 | 869 |
866 size_t QuicSession::MaxAvailableStreams() const { | 870 size_t QuicSession::MaxAvailableStreams() const { |
867 return max_open_incoming_streams_ * kMaxAvailableStreamsMultiplier; | 871 return max_open_incoming_streams_ * kMaxAvailableStreamsMultiplier; |
868 } | 872 } |
869 | 873 |
870 bool QuicSession::IsIncomingStream(QuicStreamId id) const { | 874 bool QuicSession::IsIncomingStream(QuicStreamId id) const { |
871 return id % 2 != next_outgoing_stream_id_ % 2; | 875 return id % 2 != next_outgoing_stream_id_ % 2; |
872 } | 876 } |
873 | 877 |
874 } // namespace net | 878 } // namespace net |
OLD | NEW |