| 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_bug_tracker.h" | 9 #include "net/quic/quic_bug_tracker.h" |
| 10 #include "net/quic/quic_flags.h" | 10 #include "net/quic/quic_flags.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 } | 94 } |
| 95 } | 95 } |
| 96 | 96 |
| 97 if (read_side_closed_) { | 97 if (read_side_closed_) { |
| 98 DVLOG(1) << ENDPOINT << "Ignoring data in frame " << frame.stream_id; | 98 DVLOG(1) << ENDPOINT << "Ignoring data in frame " << frame.stream_id; |
| 99 // The subclass does not want to read data: blackhole the data. | 99 // The subclass does not want to read data: blackhole the data. |
| 100 return; | 100 return; |
| 101 } | 101 } |
| 102 | 102 |
| 103 // This count includes duplicate data received. | 103 // This count includes duplicate data received. |
| 104 size_t frame_payload_size = frame.frame_length; | 104 size_t frame_payload_size = frame.data_length; |
| 105 stream_bytes_read_ += frame_payload_size; | 105 stream_bytes_read_ += frame_payload_size; |
| 106 | 106 |
| 107 // Flow control is interested in tracking highest received offset. | 107 // Flow control is interested in tracking highest received offset. |
| 108 if (MaybeIncreaseHighestReceivedOffset(frame.offset + frame_payload_size)) { | 108 if (MaybeIncreaseHighestReceivedOffset(frame.offset + frame_payload_size)) { |
| 109 // As the highest received offset has changed, check to see if this is a | 109 // As the highest received offset has changed, check to see if this is a |
| 110 // violation of flow control. | 110 // violation of flow control. |
| 111 if (flow_controller_.FlowControlViolation() || | 111 if (flow_controller_.FlowControlViolation() || |
| 112 connection_flow_controller_->FlowControlViolation()) { | 112 connection_flow_controller_->FlowControlViolation()) { |
| 113 CloseConnectionWithDetails( | 113 CloseConnectionWithDetails( |
| 114 QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA, | 114 QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA, |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 } | 451 } |
| 452 } | 452 } |
| 453 | 453 |
| 454 void ReliableQuicStream::UpdateSendWindowOffset(QuicStreamOffset new_window) { | 454 void ReliableQuicStream::UpdateSendWindowOffset(QuicStreamOffset new_window) { |
| 455 if (flow_controller_.UpdateSendWindowOffset(new_window)) { | 455 if (flow_controller_.UpdateSendWindowOffset(new_window)) { |
| 456 OnCanWrite(); | 456 OnCanWrite(); |
| 457 } | 457 } |
| 458 } | 458 } |
| 459 | 459 |
| 460 } // namespace net | 460 } // namespace net |
| OLD | NEW |