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); | |
100 } | |
101 | |
102 QuicStream* stream = GetOrCreateDynamicStream(frame.stream_id); | 98 QuicStream* stream = GetOrCreateDynamicStream(frame.stream_id); |
103 if (!stream) { | 99 if (!stream) { |
104 HandleRstOnValidNonexistentStream(frame); | 100 HandleRstOnValidNonexistentStream(frame); |
105 return; // Errors are handled by GetOrCreateStream. | 101 return; // Errors are handled by GetOrCreateStream. |
106 } | 102 } |
107 | 103 |
108 stream->OnStreamReset(frame); | 104 stream->OnStreamReset(frame); |
109 } | 105 } |
110 | 106 |
111 void QuicSession::OnGoAway(const QuicGoAwayFrame& frame) { | 107 void QuicSession::OnGoAway(const QuicGoAwayFrame& frame) { |
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 | 866 |
871 size_t QuicSession::MaxAvailableStreams() const { | 867 size_t QuicSession::MaxAvailableStreams() const { |
872 return max_open_incoming_streams_ * kMaxAvailableStreamsMultiplier; | 868 return max_open_incoming_streams_ * kMaxAvailableStreamsMultiplier; |
873 } | 869 } |
874 | 870 |
875 bool QuicSession::IsIncomingStream(QuicStreamId id) const { | 871 bool QuicSession::IsIncomingStream(QuicStreamId id) const { |
876 return id % 2 != next_outgoing_stream_id_ % 2; | 872 return id % 2 != next_outgoing_stream_id_ % 2; |
877 } | 873 } |
878 | 874 |
879 } // namespace net | 875 } // namespace net |
OLD | NEW |