| 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/quic_http_stream.h" | 5 #include "net/quic/quic_http_stream.h" |
| 6 | 6 |
| 7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "net/base/io_buffer.h" | 9 #include "net/base/io_buffer.h" |
| 10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 callback_ = callback; | 198 callback_ = callback; |
| 199 user_buffer_ = buf; | 199 user_buffer_ = buf; |
| 200 user_buffer_len_ = buf_len; | 200 user_buffer_len_ = buf_len; |
| 201 return ERR_IO_PENDING; | 201 return ERR_IO_PENDING; |
| 202 } | 202 } |
| 203 | 203 |
| 204 void QuicHttpStream::Close(bool not_reusable) { | 204 void QuicHttpStream::Close(bool not_reusable) { |
| 205 // Note: the not_reusable flag has no meaning for SPDY streams. | 205 // Note: the not_reusable flag has no meaning for SPDY streams. |
| 206 if (stream_) { | 206 if (stream_) { |
| 207 stream_->SetDelegate(NULL); | 207 stream_->SetDelegate(NULL); |
| 208 stream_->Close(QUIC_STREAM_NO_ERROR); | 208 // TODO(rch): use new CANCELLED error code here once quic 11 |
| 209 // is everywhere. |
| 210 stream_->Close(QUIC_SERVER_ERROR_PROCESSING_STREAM); |
| 209 stream_ = NULL; | 211 stream_ = NULL; |
| 210 } | 212 } |
| 211 } | 213 } |
| 212 | 214 |
| 213 HttpStream* QuicHttpStream::RenewStreamForAuth() { | 215 HttpStream* QuicHttpStream::RenewStreamForAuth() { |
| 214 return NULL; | 216 return NULL; |
| 215 } | 217 } |
| 216 | 218 |
| 217 bool QuicHttpStream::IsResponseBodyComplete() const { | 219 bool QuicHttpStream::IsResponseBodyComplete() const { |
| 218 return next_state_ == STATE_OPEN && !stream_; | 220 return next_state_ == STATE_OPEN && !stream_; |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 | 509 |
| 508 void QuicHttpStream::BufferResponseBody(const char* data, int length) { | 510 void QuicHttpStream::BufferResponseBody(const char* data, int length) { |
| 509 if (length == 0) | 511 if (length == 0) |
| 510 return; | 512 return; |
| 511 IOBufferWithSize* io_buffer = new IOBufferWithSize(length); | 513 IOBufferWithSize* io_buffer = new IOBufferWithSize(length); |
| 512 memcpy(io_buffer->data(), data, length); | 514 memcpy(io_buffer->data(), data, length); |
| 513 response_body_.push_back(make_scoped_refptr(io_buffer)); | 515 response_body_.push_back(make_scoped_refptr(io_buffer)); |
| 514 } | 516 } |
| 515 | 517 |
| 516 } // namespace net | 518 } // namespace net |
| OLD | NEW |