| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
| 6 | 6 |
| 7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
| 8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/field_trial.h" | 10 #include "base/field_trial.h" |
| (...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 // | 604 // |
| 605 // In case (4) it is less obvious what the right thing to do is. On the | 605 // In case (4) it is less obvious what the right thing to do is. On the |
| 606 // one hand, for consistency it would be natural to hard-fail as well. | 606 // one hand, for consistency it would be natural to hard-fail as well. |
| 607 // However, both Firefox 3.5 and Internet Explorer 8 will silently fall-back | 607 // However, both Firefox 3.5 and Internet Explorer 8 will silently fall-back |
| 608 // to DIRECT in this case, so we will do the same for compatibility. | 608 // to DIRECT in this case, so we will do the same for compatibility. |
| 609 // | 609 // |
| 610 // For more information, see: | 610 // For more information, see: |
| 611 // http://www.chromium.org/developers/design-documents/proxy-settings-fallback | 611 // http://www.chromium.org/developers/design-documents/proxy-settings-fallback |
| 612 | 612 |
| 613 if (proxy_info_.is_empty()) { | 613 if (proxy_info_.is_empty()) { |
| 614 // No proxies/direct to choose from. This can happen when: | 614 // No proxies/direct to choose from. This happens when we don't support any |
| 615 // a. We don't support any of the proxies in the returned list. | 615 // of the proxies in the returned list. |
| 616 // b. The proxy service returned us an empty list. | 616 return ERR_NO_SUPPORTED_PROXIES; |
| 617 // 1. this can happen if all the proxies were marked as bad already. | |
| 618 // | |
| 619 // TODO(eroman): in case (b.1) it would be better to just try the bad | |
| 620 // proxies again rather than failing without having tried anything! | |
| 621 return ERR_EMPTY_PROXY_LIST; | |
| 622 } | 617 } |
| 623 | 618 |
| 624 if (result != OK) { | 619 if (result != OK) { |
| 625 DLOG(ERROR) << "Failed to resolve proxy: " << result; | 620 DLOG(ERROR) << "Failed to resolve proxy: " << result; |
| 626 // Fall-back to direct when there were runtime errors in the PAC script, | 621 // Fall-back to direct when there were runtime errors in the PAC script, |
| 627 // or some other failure with the settings. | 622 // or some other failure with the settings. |
| 628 proxy_info_.UseDirect(); | 623 proxy_info_.UseDirect(); |
| 629 } | 624 } |
| 630 | 625 |
| 631 next_state_ = STATE_INIT_CONNECTION; | 626 next_state_ = STATE_INIT_CONNECTION; |
| (...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1866 AuthChallengeInfo* auth_info = new AuthChallengeInfo; | 1861 AuthChallengeInfo* auth_info = new AuthChallengeInfo; |
| 1867 auth_info->is_proxy = target == HttpAuth::AUTH_PROXY; | 1862 auth_info->is_proxy = target == HttpAuth::AUTH_PROXY; |
| 1868 auth_info->host_and_port = ASCIIToWide(GetHostAndPort(auth_origin)); | 1863 auth_info->host_and_port = ASCIIToWide(GetHostAndPort(auth_origin)); |
| 1869 auth_info->scheme = ASCIIToWide(auth_handler_[target]->scheme()); | 1864 auth_info->scheme = ASCIIToWide(auth_handler_[target]->scheme()); |
| 1870 // TODO(eroman): decode realm according to RFC 2047. | 1865 // TODO(eroman): decode realm according to RFC 2047. |
| 1871 auth_info->realm = ASCIIToWide(auth_handler_[target]->realm()); | 1866 auth_info->realm = ASCIIToWide(auth_handler_[target]->realm()); |
| 1872 response_.auth_challenge = auth_info; | 1867 response_.auth_challenge = auth_info; |
| 1873 } | 1868 } |
| 1874 | 1869 |
| 1875 } // namespace net | 1870 } // namespace net |
| OLD | NEW |