summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-12 19:43:00 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-12 19:43:00 +0000
commit6a621f50a408501f2ea89b4f33440f5598b13694 (patch)
tree54432431288d859a503dfb39ee79f4aa2ad27ccf
parent52884af44a0cf90730f564145e4e39adac8edcde (diff)
downloadchromium_src-6a621f50a408501f2ea89b4f33440f5598b13694.zip
chromium_src-6a621f50a408501f2ea89b4f33440f5598b13694.tar.gz
chromium_src-6a621f50a408501f2ea89b4f33440f5598b13694.tar.bz2
net: use IsSecureScheme rather than matching "https".
My r202927 matched against a scheme of "https" in order to be consistent with the other users in the same file. But it appears that IsSecureScheme is the better answer throughout the file. BUG=244260 Review URL: https://chromiumcodereview.appspot.com/16776005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205898 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--net/base/net_error_list.h2
-rw-r--r--net/http/http_proxy_client_socket_pool_spdy2_unittest.cc2
-rw-r--r--net/http/http_proxy_client_socket_pool_spdy3_unittest.cc2
-rw-r--r--net/http/http_stream_parser.cc8
-rw-r--r--net/http/http_stream_parser_unittest.cc2
5 files changed, 8 insertions, 8 deletions
diff --git a/net/base/net_error_list.h b/net/base/net_error_list.h
index fa68713..46d310f 100644
--- a/net/base/net_error_list.h
+++ b/net/base/net_error_list.h
@@ -537,7 +537,7 @@ NET_ERROR(INCOMPLETE_CHUNKED_ENCODING, -355)
NET_ERROR(QUIC_PROTOCOL_ERROR, -356)
// The HTTP headers were truncated by an EOF.
-NET_ERROR(HEADERS_TRUNCATED, -357)
+NET_ERROR(RESPONSE_HEADERS_TRUNCATED, -357)
// The cache does not have the requested entry.
NET_ERROR(CACHE_MISS, -400)
diff --git a/net/http/http_proxy_client_socket_pool_spdy2_unittest.cc b/net/http/http_proxy_client_socket_pool_spdy2_unittest.cc
index 60e39bd..ae89dbc 100644
--- a/net/http/http_proxy_client_socket_pool_spdy2_unittest.cc
+++ b/net/http/http_proxy_client_socket_pool_spdy2_unittest.cc
@@ -483,7 +483,7 @@ TEST_P(HttpProxyClientSocketPoolSpdy2Test, TunnelUnexpectedClose) {
// returns ERR_CONNECTION_CLOSED in this case.
EXPECT_EQ(ERR_CONNECTION_CLOSED, callback_.WaitForResult());
} else {
- EXPECT_EQ(ERR_HEADERS_TRUNCATED, callback_.WaitForResult());
+ EXPECT_EQ(ERR_RESPONSE_HEADERS_TRUNCATED, callback_.WaitForResult());
}
EXPECT_FALSE(handle_.is_initialized());
EXPECT_FALSE(handle_.socket());
diff --git a/net/http/http_proxy_client_socket_pool_spdy3_unittest.cc b/net/http/http_proxy_client_socket_pool_spdy3_unittest.cc
index 883f0cf..3a1acc8 100644
--- a/net/http/http_proxy_client_socket_pool_spdy3_unittest.cc
+++ b/net/http/http_proxy_client_socket_pool_spdy3_unittest.cc
@@ -484,7 +484,7 @@ TEST_P(HttpProxyClientSocketPoolSpdy3Test, TunnelUnexpectedClose) {
// returns ERR_CONNECTION_CLOSED in this case.
EXPECT_EQ(ERR_CONNECTION_CLOSED, callback_.WaitForResult());
} else {
- EXPECT_EQ(ERR_HEADERS_TRUNCATED, callback_.WaitForResult());
+ EXPECT_EQ(ERR_RESPONSE_HEADERS_TRUNCATED, callback_.WaitForResult());
}
EXPECT_FALSE(handle_.is_initialized());
EXPECT_FALSE(handle_.socket());
diff --git a/net/http/http_stream_parser.cc b/net/http/http_stream_parser.cc
index 2737eee..fbfc101 100644
--- a/net/http/http_stream_parser.cc
+++ b/net/http/http_stream_parser.cc
@@ -544,12 +544,12 @@ int HttpStreamParser::DoReadHeadersComplete(int result) {
// rather than empty HTTP/0.9 response.
io_state_ = STATE_DONE;
return ERR_EMPTY_RESPONSE;
- } else if (request_->url.SchemeIs("https")) {
+ } else if (request_->url.SchemeIsSecure()) {
// The connection was closed in the middle of the headers. For HTTPS we
// don't parse partial headers. Return a different error code so that we
// know that we shouldn't attempt to retry the request.
io_state_ = STATE_DONE;
- return ERR_HEADERS_TRUNCATED;
+ return ERR_RESPONSE_HEADERS_TRUNCATED;
}
// Parse things as well as we can and let the caller decide what to do.
int end_offset;
@@ -897,7 +897,7 @@ bool HttpStreamParser::IsConnectionReusable() const {
}
void HttpStreamParser::GetSSLInfo(SSLInfo* ssl_info) {
- if (request_->url.SchemeIs("https") && connection_->socket()) {
+ if (request_->url.SchemeIsSecure() && connection_->socket()) {
SSLClientSocket* ssl_socket =
static_cast<SSLClientSocket*>(connection_->socket());
ssl_socket->GetSSLInfo(ssl_info);
@@ -906,7 +906,7 @@ void HttpStreamParser::GetSSLInfo(SSLInfo* ssl_info) {
void HttpStreamParser::GetSSLCertRequestInfo(
SSLCertRequestInfo* cert_request_info) {
- if (request_->url.SchemeIs("https") && connection_->socket()) {
+ if (request_->url.SchemeIsSecure() && connection_->socket()) {
SSLClientSocket* ssl_socket =
static_cast<SSLClientSocket*>(connection_->socket());
ssl_socket->GetSSLCertRequestInfo(cert_request_info);
diff --git a/net/http/http_stream_parser_unittest.cc b/net/http/http_stream_parser_unittest.cc
index cf5fa41..580f434 100644
--- a/net/http/http_stream_parser_unittest.cc
+++ b/net/http/http_stream_parser_unittest.cc
@@ -405,7 +405,7 @@ TEST(HttpStreamParser, TruncatedHeaders) {
EXPECT_EQ(ERR_CONNECTION_CLOSED, rv);
EXPECT_TRUE(response_info.headers.get());
} else {
- EXPECT_EQ(ERR_HEADERS_TRUNCATED, rv);
+ EXPECT_EQ(ERR_RESPONSE_HEADERS_TRUNCATED, rv);
EXPECT_FALSE(response_info.headers.get());
}
}