Commit 125d5648 authored by Helen Li's avatar Helen Li Committed by Commit Bot

Update retryable errors in proxy_resolving_client_socket.cc when connect to proxy failed.

This CL removes the special case in proxy_resolving_client_socket.cc to not skip
retryable errors when connect to proxy fails.

Bug: 817094
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: I664a4b8926b73afc44480b240ad3b0b6e5446ad0
Reviewed-on: https://chromium-review.googlesource.com/952986Reviewed-by: default avatarSergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Helen Li <xunjieli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541520}
parent 7d0db14a
...@@ -273,9 +273,6 @@ void ProxyResolvingClientSocket::CloseTransportSocket() { ...@@ -273,9 +273,6 @@ void ProxyResolvingClientSocket::CloseTransportSocket() {
transport_.reset(); transport_.reset();
} }
// TODO(xunjieli): This following method is out of sync with
// HttpStreamFactoryImpl::JobController. The logic should be refactored into a
// common place.
// This method reconsiders the proxy on certain errors. If it does // This method reconsiders the proxy on certain errors. If it does
// reconsider a proxy it always returns ERR_IO_PENDING and posts a call to // reconsider a proxy it always returns ERR_IO_PENDING and posts a call to
// ConnectToProxy with the result of the reconsideration. // ConnectToProxy with the result of the reconsideration.
...@@ -284,28 +281,16 @@ int ProxyResolvingClientSocket::ReconsiderProxyAfterError(int error) { ...@@ -284,28 +281,16 @@ int ProxyResolvingClientSocket::ReconsiderProxyAfterError(int error) {
DCHECK_NE(error, net::OK); DCHECK_NE(error, net::OK);
DCHECK_NE(error, net::ERR_IO_PENDING); DCHECK_NE(error, net::ERR_IO_PENDING);
switch (error) { if (error == net::ERR_PROXY_AUTH_REQUESTED) {
case net::ERR_CONNECTION_TIMED_OUT: net::ProxyClientSocket* proxy_socket =
case net::ERR_PROXY_CERTIFICATE_INVALID: static_cast<net::ProxyClientSocket*>(transport_->socket());
case net::ERR_QUIC_PROTOCOL_ERROR:
case net::ERR_QUIC_HANDSHAKE_FAILED: if (proxy_socket->GetAuthController()->HaveAuth()) {
case net::ERR_SSL_PROTOCOL_ERROR: return proxy_socket->RestartWithAuth(
case net::ERR_MSG_TOO_BIG: base::BindRepeating(&ProxyResolvingClientSocket::ConnectToProxyDone,
// TODO(crbug.com/817052): Delete this special case. These errors are base::Unretained(this)));
// currently not considered fallback errors by ProxyResolvingClientSocket,
// however are by CanFalloverToNextProxy().
return error;
case net::ERR_PROXY_AUTH_REQUESTED: {
net::ProxyClientSocket* proxy_socket =
static_cast<net::ProxyClientSocket*>(transport_->socket());
if (proxy_socket->GetAuthController()->HaveAuth()) {
return proxy_socket->RestartWithAuth(
base::BindRepeating(&ProxyResolvingClientSocket::ConnectToProxyDone,
base::Unretained(this)));
}
return error;
} }
return error;
} }
// Check if the error was a proxy failure. // Check if the error was a proxy failure.
......
...@@ -590,14 +590,9 @@ const int kProxyTestMockErrors[] = { ...@@ -590,14 +590,9 @@ const int kProxyTestMockErrors[] = {
net::ERR_CONNECTION_RESET, net::ERR_CONNECTION_REFUSED, net::ERR_CONNECTION_RESET, net::ERR_CONNECTION_REFUSED,
net::ERR_CONNECTION_ABORTED, net::ERR_TUNNEL_CONNECTION_FAILED, net::ERR_CONNECTION_ABORTED, net::ERR_TUNNEL_CONNECTION_FAILED,
net::ERR_SOCKS_CONNECTION_FAILED, net::ERR_TIMED_OUT, net::ERR_SOCKS_CONNECTION_FAILED, net::ERR_TIMED_OUT,
// TODO(crbug.com/817052): Errors that should be retried but aren't: net::ERR_CONNECTION_TIMED_OUT, net::ERR_PROXY_CERTIFICATE_INVALID,
// net::ERR_CONNECTION_TIMED_OUT net::ERR_QUIC_PROTOCOL_ERROR, net::ERR_QUIC_HANDSHAKE_FAILED,
// net::ERR_PROXY_CERTIFICATE_INVALID, net::ERR_SSL_PROTOCOL_ERROR, net::ERR_MSG_TOO_BIG};
// net::ERR_QUIC_PROTOCOL_ERROR,
// net::ERR_QUIC_HANDSHAKE_FAILED,
// net::ERR_SSL_PROTOCOL_ERROR,
// net::ERR_MSG_TOO_BIG,
};
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_CASE_P(
/* no prefix */, /* no prefix */,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment