OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/http/http_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
6 | 6 |
7 #include "base/scoped_ptr.h" | 7 #include "base/scoped_ptr.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/field_trial.h" | 9 #include "base/field_trial.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 return ERR_EMPTY_RESPONSE; | 746 return ERR_EMPTY_RESPONSE; |
747 } | 747 } |
748 | 748 |
749 // Assume everything else is a HTTP/0.9 response (including responses | 749 // Assume everything else is a HTTP/0.9 response (including responses |
750 // of 'h', 'ht', 'htt'). | 750 // of 'h', 'ht', 'htt'). |
751 header_buf_body_offset_ = 0; | 751 header_buf_body_offset_ = 0; |
752 return OK; | 752 return OK; |
753 } | 753 } |
754 | 754 |
755 int HttpNetworkTransaction::DoReadHeadersComplete(int result) { | 755 int HttpNetworkTransaction::DoReadHeadersComplete(int result) { |
| 756 if (using_ssl_ && IsCertificateError(result)) { |
| 757 // We don't handle a certificate error during SSL renegotiation, so we |
| 758 // have to return an error that's not in the certificate error range |
| 759 // (-2xx). |
| 760 LOG(ERROR) << "Got a server certificate with error " << result |
| 761 << " during SSL renegotiation"; |
| 762 result = ERR_CERT_ERROR_IN_SSL_RENEGOTIATION; |
| 763 } |
| 764 |
756 if (result < 0) | 765 if (result < 0) |
757 return HandleIOError(result); | 766 return HandleIOError(result); |
758 | 767 |
759 if (result == 0 && ShouldResendRequest()) | 768 if (result == 0 && ShouldResendRequest()) |
760 return result; | 769 return result; |
761 | 770 |
762 // Record our best estimate of the 'response time' as the time when we read | 771 // Record our best estimate of the 'response time' as the time when we read |
763 // the first bytes of the response headers. | 772 // the first bytes of the response headers. |
764 if (header_buf_len_ == 0) | 773 if (header_buf_len_ == 0) |
765 response_.response_time = Time::Now(); | 774 response_.response_time = Time::Now(); |
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1532 if (target == HttpAuth::AUTH_PROXY) { | 1541 if (target == HttpAuth::AUTH_PROXY) { |
1533 auth_info->host = ASCIIToWide(proxy_info_.proxy_server().host_and_port()); | 1542 auth_info->host = ASCIIToWide(proxy_info_.proxy_server().host_and_port()); |
1534 } else { | 1543 } else { |
1535 DCHECK(target == HttpAuth::AUTH_SERVER); | 1544 DCHECK(target == HttpAuth::AUTH_SERVER); |
1536 auth_info->host = ASCIIToWide(request_->url.host()); | 1545 auth_info->host = ASCIIToWide(request_->url.host()); |
1537 } | 1546 } |
1538 response_.auth_challenge = auth_info; | 1547 response_.auth_challenge = auth_info; |
1539 } | 1548 } |
1540 | 1549 |
1541 } // namespace net | 1550 } // namespace net |
OLD | NEW |