| 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/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "base/strings/string_split.h" | 9 #include "base/strings/string_split.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 return; | 522 return; |
| 523 } | 523 } |
| 524 | 524 |
| 525 CHECK(!callback_.is_null()); | 525 CHECK(!callback_.is_null()); |
| 526 user_buffer_ = nullptr; | 526 user_buffer_ = nullptr; |
| 527 user_buffer_len_ = 0; | 527 user_buffer_len_ = 0; |
| 528 DoCallback(rv); | 528 DoCallback(rv); |
| 529 } | 529 } |
| 530 | 530 |
| 531 void QuicHttpStream::OnClose(QuicErrorCode error) { | 531 void QuicHttpStream::OnClose(QuicErrorCode error) { |
| 532 if (error != QUIC_NO_ERROR) { | 532 if (error != QUIC_NO_ERROR || |
| 533 stream_->stream_error() != QUIC_STREAM_NO_ERROR) { |
| 533 response_status_ = was_handshake_confirmed_ ? ERR_QUIC_PROTOCOL_ERROR | 534 response_status_ = was_handshake_confirmed_ ? ERR_QUIC_PROTOCOL_ERROR |
| 534 : ERR_QUIC_HANDSHAKE_FAILED; | 535 : ERR_QUIC_HANDSHAKE_FAILED; |
| 535 } else if (!response_headers_received_) { | 536 } else if (!response_headers_received_) { |
| 536 response_status_ = ERR_ABORTED; | 537 response_status_ = ERR_ABORTED; |
| 537 } | 538 } |
| 538 | 539 |
| 539 ResetStream(); | 540 ResetStream(); |
| 540 if (!callback_.is_null()) { | 541 if (!callback_.is_null()) { |
| 541 quic_connection_error_ = error; | 542 quic_connection_error_ = error; |
| 542 DoCallback(response_status_); | 543 DoCallback(response_status_); |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 closed_stream_sent_bytes_ = stream_->stream_bytes_written(); | 776 closed_stream_sent_bytes_ = stream_->stream_bytes_written(); |
| 776 stream_ = nullptr; | 777 stream_ = nullptr; |
| 777 | 778 |
| 778 // If |request_body_stream_| is non-NULL, Reset it, to abort any in progress | 779 // If |request_body_stream_| is non-NULL, Reset it, to abort any in progress |
| 779 // read. | 780 // read. |
| 780 if (request_body_stream_) | 781 if (request_body_stream_) |
| 781 request_body_stream_->Reset(); | 782 request_body_stream_->Reset(); |
| 782 } | 783 } |
| 783 | 784 |
| 784 } // namespace net | 785 } // namespace net |
| OLD | NEW |