summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-17 09:47:52 +0000
committereroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-17 09:47:52 +0000
commit78e9ffbdaf6c441dbd333fa70247397629fcf148 (patch)
treedd749dc0bbc34052229d6b78db3cdd6be3bee992
parent8e670d2438cf9c8b9c6408a32deab12b4d8e9f4f (diff)
downloadchromium_src-78e9ffbdaf6c441dbd333fa70247397629fcf148.zip
chromium_src-78e9ffbdaf6c441dbd333fa70247397629fcf148.tar.gz
chromium_src-78e9ffbdaf6c441dbd333fa70247397629fcf148.tar.bz2
Merge r37566 to the 307 branch - 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 unittest 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 TBR=eroman@chromium.org Review URL: http://codereview.chromium.org/608028 git-svn-id: svn://svn.chromium.org/chrome/branches/307/src@39210 0039d316-1c4b-4281-b951-d872f2087c98
-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).