| 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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 | 450 |
| 451 void ReliableQuicStream::OnClose() { | 451 void ReliableQuicStream::OnClose() { |
| 452 CloseReadSide(); | 452 CloseReadSide(); |
| 453 CloseWriteSide(); | 453 CloseWriteSide(); |
| 454 | 454 |
| 455 if (!fin_sent_ && !rst_sent_) { | 455 if (!fin_sent_ && !rst_sent_) { |
| 456 // For flow control accounting, we must tell the peer how many bytes we have | 456 // For flow control accounting, we must tell the peer how many bytes we have |
| 457 // written on this stream before termination. Done here if needed, using a | 457 // written on this stream before termination. Done here if needed, using a |
| 458 // RST frame. | 458 // RST frame. |
| 459 DVLOG(1) << ENDPOINT << "Sending RST in OnClose: " << id(); | 459 DVLOG(1) << ENDPOINT << "Sending RST in OnClose: " << id(); |
| 460 session_->SendRstStream(id(), QUIC_RST_FLOW_CONTROL_ACCOUNTING, | 460 session_->SendRstStream(id(), QUIC_RST_ACKNOWLEDGEMENT, |
| 461 stream_bytes_written_); | 461 stream_bytes_written_); |
| 462 rst_sent_ = true; | 462 rst_sent_ = true; |
| 463 } | 463 } |
| 464 | 464 |
| 465 // We are closing the stream and will not process any further incoming bytes. | 465 // We are closing the stream and will not process any further incoming bytes. |
| 466 // As there may be more bytes in flight and we need to ensure that both | 466 // As there may be more bytes in flight and we need to ensure that both |
| 467 // endpoints have the same connection level flow control state, mark all | 467 // endpoints have the same connection level flow control state, mark all |
| 468 // unreceived or buffered bytes as consumed. | 468 // unreceived or buffered bytes as consumed. |
| 469 uint64 bytes_to_consume = flow_controller_.highest_received_byte_offset() - | 469 uint64 bytes_to_consume = flow_controller_.highest_received_byte_offset() - |
| 470 flow_controller_.bytes_consumed(); | 470 flow_controller_.bytes_consumed(); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 | 538 |
| 539 bool ReliableQuicStream::IsFlowControlBlocked() { | 539 bool ReliableQuicStream::IsFlowControlBlocked() { |
| 540 if (flow_controller_.IsBlocked()) { | 540 if (flow_controller_.IsBlocked()) { |
| 541 return true; | 541 return true; |
| 542 } | 542 } |
| 543 return stream_contributes_to_connection_flow_control_ && | 543 return stream_contributes_to_connection_flow_control_ && |
| 544 connection_flow_controller_->IsBlocked(); | 544 connection_flow_controller_->IsBlocked(); |
| 545 } | 545 } |
| 546 | 546 |
| 547 } // namespace net | 547 } // namespace net |
| OLD | NEW |