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 | |
| 5 | #include "net/third_party/quiche/src/quic/tools/quic_simple_client_stream.h" |
| 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 | |
| 29 | void QuicSimpleClientStream::OnStopSending(uint16_t code) { |
| 30 | last_stop_sending_code_ = code; |
| 31 | } |
| 32 | |
| 33 | } // namespace quic |