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