| 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 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 return; | 490 return; |
| 491 } | 491 } |
| 492 | 492 |
| 493 CHECK(!callback_.is_null()); | 493 CHECK(!callback_.is_null()); |
| 494 user_buffer_ = nullptr; | 494 user_buffer_ = nullptr; |
| 495 user_buffer_len_ = 0; | 495 user_buffer_len_ = 0; |
| 496 DoCallback(rv); | 496 DoCallback(rv); |
| 497 } | 497 } |
| 498 | 498 |
| 499 void QuicHttpStream::OnClose(QuicErrorCode error) { | 499 void QuicHttpStream::OnClose(QuicErrorCode error) { |
| 500 if (error != QUIC_NO_ERROR) { | 500 if (error != QUIC_NO_ERROR || |
| 501 stream_->stream_error() != QUIC_STREAM_NO_ERROR) { |
| 501 response_status_ = was_handshake_confirmed_ ? ERR_QUIC_PROTOCOL_ERROR | 502 response_status_ = was_handshake_confirmed_ ? ERR_QUIC_PROTOCOL_ERROR |
| 502 : ERR_QUIC_HANDSHAKE_FAILED; | 503 : ERR_QUIC_HANDSHAKE_FAILED; |
| 503 } else if (!response_headers_received_) { | 504 } else if (!response_headers_received_) { |
| 504 response_status_ = ERR_ABORTED; | 505 response_status_ = ERR_ABORTED; |
| 505 } | 506 } |
| 506 | 507 |
| 507 ResetStream(); | 508 ResetStream(); |
| 508 if (!callback_.is_null()) { | 509 if (!callback_.is_null()) { |
| 509 quic_connection_error_ = error; | 510 quic_connection_error_ = error; |
| 510 DoCallback(response_status_); | 511 DoCallback(response_status_); |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 closed_stream_sent_bytes_ = stream_->stream_bytes_written(); | 813 closed_stream_sent_bytes_ = stream_->stream_bytes_written(); |
| 813 stream_ = nullptr; | 814 stream_ = nullptr; |
| 814 | 815 |
| 815 // If |request_body_stream_| is non-NULL, Reset it, to abort any in progress | 816 // If |request_body_stream_| is non-NULL, Reset it, to abort any in progress |
| 816 // read. | 817 // read. |
| 817 if (request_body_stream_) | 818 if (request_body_stream_) |
| 818 request_body_stream_->Reset(); | 819 request_body_stream_->Reset(); |
| 819 } | 820 } |
| 820 | 821 |
| 821 } // namespace net | 822 } // namespace net |
| OLD | NEW |