| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/scoped_ptr.h" | 7 #include "base/scoped_ptr.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/trace_event.h" | 10 #include "base/trace_event.h" |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 } while (rv != ERR_IO_PENDING && next_state_ != STATE_NONE); | 383 } while (rv != ERR_IO_PENDING && next_state_ != STATE_NONE); |
| 384 | 384 |
| 385 return rv; | 385 return rv; |
| 386 } | 386 } |
| 387 | 387 |
| 388 int HttpNetworkTransaction::DoResolveProxy() { | 388 int HttpNetworkTransaction::DoResolveProxy() { |
| 389 DCHECK(!pac_request_); | 389 DCHECK(!pac_request_); |
| 390 | 390 |
| 391 next_state_ = STATE_RESOLVE_PROXY_COMPLETE; | 391 next_state_ = STATE_RESOLVE_PROXY_COMPLETE; |
| 392 | 392 |
| 393 if (request_->load_flags & LOAD_BYPASS_PROXY) { |
| 394 proxy_info_.UseDirect(); |
| 395 return OK; |
| 396 } |
| 397 |
| 393 return session_->proxy_service()->ResolveProxy( | 398 return session_->proxy_service()->ResolveProxy( |
| 394 request_->url, &proxy_info_, &io_callback_, &pac_request_); | 399 request_->url, &proxy_info_, &io_callback_, &pac_request_); |
| 395 } | 400 } |
| 396 | 401 |
| 397 int HttpNetworkTransaction::DoResolveProxyComplete(int result) { | 402 int HttpNetworkTransaction::DoResolveProxyComplete(int result) { |
| 398 next_state_ = STATE_INIT_CONNECTION; | 403 next_state_ = STATE_INIT_CONNECTION; |
| 399 | 404 |
| 400 pac_request_ = NULL; | 405 pac_request_ = NULL; |
| 401 | 406 |
| 402 if (result != OK) { | 407 if (result != OK) { |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1021 case ERR_CONNECTION_RESET: | 1026 case ERR_CONNECTION_RESET: |
| 1022 case ERR_CONNECTION_REFUSED: | 1027 case ERR_CONNECTION_REFUSED: |
| 1023 case ERR_CONNECTION_ABORTED: | 1028 case ERR_CONNECTION_ABORTED: |
| 1024 case ERR_TIMED_OUT: | 1029 case ERR_TIMED_OUT: |
| 1025 case ERR_TUNNEL_CONNECTION_FAILED: | 1030 case ERR_TUNNEL_CONNECTION_FAILED: |
| 1026 break; | 1031 break; |
| 1027 default: | 1032 default: |
| 1028 return error; | 1033 return error; |
| 1029 } | 1034 } |
| 1030 | 1035 |
| 1036 if (request_->load_flags & LOAD_BYPASS_PROXY) { |
| 1037 return error; |
| 1038 } |
| 1039 |
| 1031 int rv = session_->proxy_service()->ReconsiderProxyAfterError( | 1040 int rv = session_->proxy_service()->ReconsiderProxyAfterError( |
| 1032 request_->url, &proxy_info_, &io_callback_, &pac_request_); | 1041 request_->url, &proxy_info_, &io_callback_, &pac_request_); |
| 1033 if (rv == OK || rv == ERR_IO_PENDING) { | 1042 if (rv == OK || rv == ERR_IO_PENDING) { |
| 1034 connection_.set_socket(NULL); | 1043 connection_.set_socket(NULL); |
| 1035 connection_.Reset(); | 1044 connection_.Reset(); |
| 1036 DCHECK(!request_headers_bytes_sent_); | 1045 DCHECK(!request_headers_bytes_sent_); |
| 1037 next_state_ = STATE_RESOLVE_PROXY_COMPLETE; | 1046 next_state_ = STATE_RESOLVE_PROXY_COMPLETE; |
| 1038 } else { | 1047 } else { |
| 1039 rv = error; | 1048 rv = error; |
| 1040 } | 1049 } |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1249 if (target == HttpAuth::AUTH_PROXY) { | 1258 if (target == HttpAuth::AUTH_PROXY) { |
| 1250 auth_info->host = ASCIIToWide(proxy_info_.proxy_server()); | 1259 auth_info->host = ASCIIToWide(proxy_info_.proxy_server()); |
| 1251 } else { | 1260 } else { |
| 1252 DCHECK(target == HttpAuth::AUTH_SERVER); | 1261 DCHECK(target == HttpAuth::AUTH_SERVER); |
| 1253 auth_info->host = ASCIIToWide(request_->url.host()); | 1262 auth_info->host = ASCIIToWide(request_->url.host()); |
| 1254 } | 1263 } |
| 1255 response_.auth_challenge = auth_info; | 1264 response_.auth_challenge = auth_info; |
| 1256 } | 1265 } |
| 1257 | 1266 |
| 1258 } // namespace net | 1267 } // namespace net |
| OLD | NEW |