Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: net/http/http_stream_factory_impl_job.cc

Issue 939083003: Bypass QUIC proxy on ERR_QUIC_HANDSHAKE_FAILED (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | net/http/http_stream_factory_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/http/http_stream_factory_impl_job.h" 5 #include "net/http/http_stream_factory_impl_job.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 using_spdy_ = true; 897 using_spdy_ = true;
898 next_state_ = STATE_CREATE_STREAM; 898 next_state_ = STATE_CREATE_STREAM;
899 } else { 899 } else {
900 // It is possible that the spdy session no longer exists. 900 // It is possible that the spdy session no longer exists.
901 ReturnToStateInitConnection(true /* close connection */); 901 ReturnToStateInitConnection(true /* close connection */);
902 } 902 }
903 return OK; 903 return OK;
904 } 904 }
905 905
906 if (proxy_info_.is_quic() && using_quic_ && 906 if (proxy_info_.is_quic() && using_quic_ &&
907 result == ERR_QUIC_PROTOCOL_ERROR) { 907 (result == ERR_QUIC_PROTOCOL_ERROR ||
908 result == ERR_QUIC_HANDSHAKE_FAILED)) {
908 using_quic_ = false; 909 using_quic_ = false;
909 return ReconsiderProxyAfterError(result); 910 return ReconsiderProxyAfterError(result);
910 } 911 }
911 912
912 // TODO(willchan): Make this a bit more exact. Maybe there are recoverable 913 // TODO(willchan): Make this a bit more exact. Maybe there are recoverable
913 // errors, such as ignoring certificate errors for Alternate-Protocol. 914 // errors, such as ignoring certificate errors for Alternate-Protocol.
914 if (result < 0 && waiting_job_) { 915 if (result < 0 && waiting_job_) {
915 waiting_job_->Resume(this); 916 waiting_job_->Resume(this);
916 waiting_job_ = NULL; 917 waiting_job_ = NULL;
917 } 918 }
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
1313 case ERR_CONNECTION_ABORTED: 1314 case ERR_CONNECTION_ABORTED:
1314 case ERR_TIMED_OUT: 1315 case ERR_TIMED_OUT:
1315 case ERR_TUNNEL_CONNECTION_FAILED: 1316 case ERR_TUNNEL_CONNECTION_FAILED:
1316 case ERR_SOCKS_CONNECTION_FAILED: 1317 case ERR_SOCKS_CONNECTION_FAILED:
1317 // This can happen in the case of trying to talk to a proxy using SSL, and 1318 // This can happen in the case of trying to talk to a proxy using SSL, and
1318 // ending up talking to a captive portal that supports SSL instead. 1319 // ending up talking to a captive portal that supports SSL instead.
1319 case ERR_PROXY_CERTIFICATE_INVALID: 1320 case ERR_PROXY_CERTIFICATE_INVALID:
1320 // This can happen when trying to talk SSL to a non-SSL server (Like a 1321 // This can happen when trying to talk SSL to a non-SSL server (Like a
1321 // captive portal). 1322 // captive portal).
1322 case ERR_QUIC_PROTOCOL_ERROR: 1323 case ERR_QUIC_PROTOCOL_ERROR:
1324 case ERR_QUIC_HANDSHAKE_FAILED:
1323 case ERR_SSL_PROTOCOL_ERROR: 1325 case ERR_SSL_PROTOCOL_ERROR:
1324 break; 1326 break;
1325 case ERR_SOCKS_CONNECTION_HOST_UNREACHABLE: 1327 case ERR_SOCKS_CONNECTION_HOST_UNREACHABLE:
1326 // Remap the SOCKS-specific "host unreachable" error to a more 1328 // Remap the SOCKS-specific "host unreachable" error to a more
1327 // generic error code (this way consumers like the link doctor 1329 // generic error code (this way consumers like the link doctor
1328 // know to substitute their error page). 1330 // know to substitute their error page).
1329 // 1331 //
1330 // Note that if the host resolving was done by the SOCKS5 proxy, we can't 1332 // Note that if the host resolving was done by the SOCKS5 proxy, we can't
1331 // differentiate between a proxy-side "host not found" versus a proxy-side 1333 // differentiate between a proxy-side "host not found" versus a proxy-side
1332 // "address unreachable" error, and will report both of these failures as 1334 // "address unreachable" error, and will report both of these failures as
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1488 1490
1489 if (job_status_ == STATUS_SUCCEEDED && other_job_status_ == STATUS_BROKEN) { 1491 if (job_status_ == STATUS_SUCCEEDED && other_job_status_ == STATUS_BROKEN) {
1490 HistogramBrokenAlternateProtocolLocation( 1492 HistogramBrokenAlternateProtocolLocation(
1491 BROKEN_ALTERNATE_PROTOCOL_LOCATION_HTTP_STREAM_FACTORY_IMPL_JOB_MAIN); 1493 BROKEN_ALTERNATE_PROTOCOL_LOCATION_HTTP_STREAM_FACTORY_IMPL_JOB_MAIN);
1492 session_->http_server_properties()->SetBrokenAlternateProtocol( 1494 session_->http_server_properties()->SetBrokenAlternateProtocol(
1493 HostPortPair::FromURL(request_info_.url)); 1495 HostPortPair::FromURL(request_info_.url));
1494 } 1496 }
1495 } 1497 }
1496 1498
1497 } // namespace net 1499 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/http/http_stream_factory_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698