| 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/tools/quic/quic_spdy_client_stream.h" | 5 #include "net/tools/quic/quic_spdy_client_stream.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 namespace net { | 23 namespace net { |
| 24 | 24 |
| 25 QuicSpdyClientStream::QuicSpdyClientStream(QuicStreamId id, | 25 QuicSpdyClientStream::QuicSpdyClientStream(QuicStreamId id, |
| 26 QuicClientSession* session) | 26 QuicClientSession* session) |
| 27 : QuicSpdyStream(id, session), | 27 : QuicSpdyStream(id, session), |
| 28 content_length_(-1), | 28 content_length_(-1), |
| 29 response_code_(0), | 29 response_code_(0), |
| 30 header_bytes_read_(0), | 30 header_bytes_read_(0), |
| 31 header_bytes_written_(0), | 31 header_bytes_written_(0), |
| 32 allow_bidirectional_data_(false), | |
| 33 session_(session) {} | 32 session_(session) {} |
| 34 | 33 |
| 35 QuicSpdyClientStream::~QuicSpdyClientStream() {} | 34 QuicSpdyClientStream::~QuicSpdyClientStream() {} |
| 36 | 35 |
| 37 void QuicSpdyClientStream::OnStreamFrame(const QuicStreamFrame& frame) { | 36 void QuicSpdyClientStream::OnStreamFrame(const QuicStreamFrame& frame) { |
| 38 if (!allow_bidirectional_data_ && !write_side_closed()) { | 37 if (!allow_bidirectional_data() && !write_side_closed()) { |
| 39 DVLOG(1) << "Got a response before the request was complete. " | 38 DVLOG(1) << "Got a response before the request was complete. " |
| 40 << "Aborting request."; | 39 << "Aborting request."; |
| 41 CloseWriteSide(); | 40 CloseWriteSide(); |
| 42 } | 41 } |
| 43 QuicSpdyStream::OnStreamFrame(frame); | 42 QuicSpdyStream::OnStreamFrame(frame); |
| 44 } | 43 } |
| 45 | 44 |
| 46 void QuicSpdyClientStream::OnInitialHeadersComplete(bool fin, | 45 void QuicSpdyClientStream::OnInitialHeadersComplete(bool fin, |
| 47 size_t frame_len) { | 46 size_t frame_len) { |
| 48 QuicSpdyStream::OnInitialHeadersComplete(fin, frame_len); | 47 QuicSpdyStream::OnInitialHeadersComplete(fin, frame_len); |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 bytes_sent += header_bytes_written_; | 189 bytes_sent += header_bytes_written_; |
| 191 | 190 |
| 192 if (!body.empty()) { | 191 if (!body.empty()) { |
| 193 WriteOrBufferData(body, fin, nullptr); | 192 WriteOrBufferData(body, fin, nullptr); |
| 194 } | 193 } |
| 195 | 194 |
| 196 return bytes_sent; | 195 return bytes_sent; |
| 197 } | 196 } |
| 198 | 197 |
| 199 } // namespace net | 198 } // namespace net |
| OLD | NEW |