| 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_flow_controller.h" | 9 #include "net/quic/quic_flow_controller.h" |
| 10 #include "net/quic/quic_session.h" | 10 #include "net/quic/quic_session.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 150 |
| 151 if (frame.stream_id != id_) { | 151 if (frame.stream_id != id_) { |
| 152 session_->connection()->SendConnectionClose(QUIC_INTERNAL_ERROR); | 152 session_->connection()->SendConnectionClose(QUIC_INTERNAL_ERROR); |
| 153 return; | 153 return; |
| 154 } | 154 } |
| 155 | 155 |
| 156 if (frame.fin) { | 156 if (frame.fin) { |
| 157 fin_received_ = true; | 157 fin_received_ = true; |
| 158 } | 158 } |
| 159 | 159 |
| 160 // This count include duplicate data received. | 160 // This count includes duplicate data received. |
| 161 size_t frame_payload_size = frame.data.TotalBufferSize(); | 161 size_t frame_payload_size = frame.data.TotalBufferSize(); |
| 162 stream_bytes_read_ += frame_payload_size; | 162 stream_bytes_read_ += frame_payload_size; |
| 163 | 163 |
| 164 // Flow control is interested in tracking highest received offset. | 164 // Flow control is interested in tracking highest received offset. |
| 165 if (MaybeIncreaseHighestReceivedOffset(frame.offset + frame_payload_size)) { | 165 if (MaybeIncreaseHighestReceivedOffset(frame.offset + frame_payload_size)) { |
| 166 // As the highest received offset has changed, we should check to see if | 166 // As the highest received offset has changed, we should check to see if |
| 167 // this is a violation of flow control. | 167 // this is a violation of flow control. |
| 168 if (flow_controller_.FlowControlViolation() || | 168 if (flow_controller_.FlowControlViolation() || |
| 169 connection_flow_controller_->FlowControlViolation()) { | 169 connection_flow_controller_->FlowControlViolation()) { |
| 170 session_->connection()->SendConnectionClose( | 170 session_->connection()->SendConnectionClose( |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 } | 509 } |
| 510 } | 510 } |
| 511 | 511 |
| 512 void ReliableQuicStream::UpdateSendWindowOffset(QuicStreamOffset new_window) { | 512 void ReliableQuicStream::UpdateSendWindowOffset(QuicStreamOffset new_window) { |
| 513 if (flow_controller_.UpdateSendWindowOffset(new_window)) { | 513 if (flow_controller_.UpdateSendWindowOffset(new_window)) { |
| 514 OnCanWrite(); | 514 OnCanWrite(); |
| 515 } | 515 } |
| 516 } | 516 } |
| 517 | 517 |
| 518 } // namespace net | 518 } // namespace net |
| OLD | NEW |