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/reliable_quic_stream.h" | 5 #include "net/quic/reliable_quic_stream.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "net/quic/iovector.h" | 8 #include "net/quic/iovector.h" |
9 #include "net/quic/quic_ack_listener_interface.h" | 9 #include "net/quic/quic_ack_listener_interface.h" |
10 #include "net/quic/quic_flags.h" | 10 #include "net/quic/quic_flags.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 // This count includes duplicate data received. | 108 // This count includes duplicate data received. |
109 size_t frame_payload_size = frame.frame_length; | 109 size_t frame_payload_size = frame.frame_length; |
110 stream_bytes_read_ += frame_payload_size; | 110 stream_bytes_read_ += frame_payload_size; |
111 | 111 |
112 // Flow control is interested in tracking highest received offset. | 112 // Flow control is interested in tracking highest received offset. |
113 if (MaybeIncreaseHighestReceivedOffset(frame.offset + frame_payload_size)) { | 113 if (MaybeIncreaseHighestReceivedOffset(frame.offset + frame_payload_size)) { |
114 // As the highest received offset has changed, check to see if this is a | 114 // As the highest received offset has changed, check to see if this is a |
115 // violation of flow control. | 115 // violation of flow control. |
116 if (flow_controller_.FlowControlViolation() || | 116 if (flow_controller_.FlowControlViolation() || |
117 connection_flow_controller_->FlowControlViolation()) { | 117 connection_flow_controller_->FlowControlViolation()) { |
118 session_->connection()->SendConnectionClose( | 118 session_->connection()->SendConnectionCloseWithDetails( |
119 QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA); | 119 QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA, |
| 120 "Flow control violation after increasing offset"); |
120 return; | 121 return; |
121 } | 122 } |
122 } | 123 } |
123 | 124 |
124 sequencer_.OnStreamFrame(frame); | 125 sequencer_.OnStreamFrame(frame); |
125 } | 126 } |
126 | 127 |
127 int ReliableQuicStream::num_frames_received() const { | 128 int ReliableQuicStream::num_frames_received() const { |
128 return sequencer_.num_frames_received(); | 129 return sequencer_.num_frames_received(); |
129 } | 130 } |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 } | 459 } |
459 } | 460 } |
460 | 461 |
461 void ReliableQuicStream::UpdateSendWindowOffset(QuicStreamOffset new_window) { | 462 void ReliableQuicStream::UpdateSendWindowOffset(QuicStreamOffset new_window) { |
462 if (flow_controller_.UpdateSendWindowOffset(new_window)) { | 463 if (flow_controller_.UpdateSendWindowOffset(new_window)) { |
463 OnCanWrite(); | 464 OnCanWrite(); |
464 } | 465 } |
465 } | 466 } |
466 | 467 |
467 } // namespace net | 468 } // namespace net |
OLD | NEW |