QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 1 | // Copyright (c) 2018 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
QUICHE team | 5be974e | 2020-12-29 18:35:24 -0500 | [diff] [blame] | 5 | #include "quic/tools/quic_simple_client_stream.h" |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 6 | |
| 7 | namespace quic { |
| 8 | |
| 9 | void QuicSimpleClientStream::OnBodyAvailable() { |
| 10 | if (!drop_response_body_) { |
| 11 | QuicSpdyClientStream::OnBodyAvailable(); |
| 12 | return; |
| 13 | } |
| 14 | |
| 15 | while (HasBytesToRead()) { |
| 16 | struct iovec iov; |
| 17 | if (GetReadableRegions(&iov, 1) == 0) { |
| 18 | break; |
| 19 | } |
| 20 | MarkConsumed(iov.iov_len); |
| 21 | } |
| 22 | if (sequencer()->IsClosed()) { |
| 23 | OnFinRead(); |
| 24 | } else { |
| 25 | sequencer()->SetUnblocked(); |
| 26 | } |
| 27 | } |
| 28 | |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 29 | } // namespace quic |