summaryrefslogtreecommitdiffstats
path: root/net/http
diff options
context:
space:
mode:
authoreroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-29 23:45:29 +0000
committereroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-29 23:45:29 +0000
commit59a1601191d257bee204ab959d82808a0ea06491 (patch)
tree1684f6f2faec14b2fbaeceef9c2bea8c613c9b31 /net/http
parent4cbc71e9c6f1fec187e0f16de08a16ad3db71740 (diff)
downloadchromium_src-59a1601191d257bee204ab959d82808a0ea06491.zip
chromium_src-59a1601191d257bee204ab959d82808a0ea06491.tar.gz
chromium_src-59a1601191d257bee204ab959d82808a0ea06491.tar.bz2
Fix a regression from r35549 that caused failure in evaluation of PAC script to result in ERR_NO_SUPPORTED_PROXIES rather than falling back to DIRECT.
BUG=32316 TEST= No unit-test yet. To test manually: (1) create a PAC script with contents: function FindProxyForURL(url, host) { throw "FAILURE!" } (2) Change the proxy settings to point at this file (can use a file:// URL if it is local). (3) Load http://www.google.com/. Should succeed. Without the bug fix, it would fail with ERR_NO_SUPPORTED_PROXIES. Review URL: http://codereview.chromium.org/549204 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37566 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
-rw-r--r--net/http/http_network_transaction.cc14
-rw-r--r--net/http/http_network_transaction_unittest.cc4
2 files changed, 11 insertions, 7 deletions
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index 6d62d30..8bbc883 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -579,6 +579,13 @@ int HttpNetworkTransaction::DoResolveProxyComplete(int result) {
pac_request_ = NULL;
+ if (result != OK) {
+ DLOG(ERROR) << "Failed to resolve proxy: " << result;
+ // Fall-back to direct when there were runtime errors in the PAC script,
+ // or some other failure with the settings.
+ proxy_info_.UseDirect();
+ }
+
// Remove unsupported proxies from the list.
proxy_info_.RemoveProxiesWithoutScheme(
ProxyServer::SCHEME_DIRECT | ProxyServer::SCHEME_HTTP |
@@ -616,13 +623,6 @@ int HttpNetworkTransaction::DoResolveProxyComplete(int result) {
return ERR_NO_SUPPORTED_PROXIES;
}
- if (result != OK) {
- DLOG(ERROR) << "Failed to resolve proxy: " << result;
- // Fall-back to direct when there were runtime errors in the PAC script,
- // or some other failure with the settings.
- proxy_info_.UseDirect();
- }
-
next_state_ = STATE_INIT_CONNECTION;
return OK;
}
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc
index 380bd49..7be3390 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -28,6 +28,10 @@
//-----------------------------------------------------------------------------
+// TODO(eroman): Add a regression test for http://crbug.com/32316 -- when the
+// proxy service returns an error, we should fallback to DIRECT instead of
+// failing with ERR_NO_SUPPORTED_PROXIES.
+
namespace net {
// Create a proxy service which fails on all requests (falls back to direct).