diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-04 05:28:40 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-04 05:28:40 +0000 |
commit | d207a5f9ff5af30e4d1dabdeb61c2164a926fd2b (patch) | |
tree | 0d4619b4a982a79f4af8e29ccfcc623e51d9aca5 /net/http/http_network_transaction.h | |
parent | 079fc0db5e3faeda06f20dcf36bbaad49381069c (diff) | |
download | chromium_src-d207a5f9ff5af30e4d1dabdeb61c2164a926fd2b.zip chromium_src-d207a5f9ff5af30e4d1dabdeb61c2164a926fd2b.tar.gz chromium_src-d207a5f9ff5af30e4d1dabdeb61c2164a926fd2b.tar.bz2 |
Reland my ClientSocketPool refactor again...
The bug was that the handle was getting reused, so the ConnectingSocket doesn't know that it got canceled. It just keeps chugging away.
I added a map to keep track of the ConnectingSockets so they can be canceled if we detect a reuse.
TBR=wtc
Review URL: http://codereview.chromium.org/118219
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17606 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_network_transaction.h')
-rw-r--r-- | net/http/http_network_transaction.h | 51 |
1 files changed, 24 insertions, 27 deletions
diff --git a/net/http/http_network_transaction.h b/net/http/http_network_transaction.h index 57bd6cc..3c3811d 100644 --- a/net/http/http_network_transaction.h +++ b/net/http/http_network_transaction.h @@ -12,8 +12,11 @@ #include "base/time.h" #include "net/base/address_list.h" #include "net/base/client_socket_handle.h" +#include "net/base/client_socket_pool.h" #include "net/base/host_resolver.h" #include "net/base/io_buffer.h" +#include "net/base/load_flags.h" +#include "net/base/load_states.h" #include "net/base/ssl_config_service.h" #include "net/http/http_auth.h" #include "net/http/http_auth_handler.h" @@ -88,6 +91,26 @@ class HttpNetworkTransaction : public HttpTransaction { scoped_ptr_malloc<char> headers_; }; + enum State { + STATE_RESOLVE_PROXY, + STATE_RESOLVE_PROXY_COMPLETE, + STATE_INIT_CONNECTION, + STATE_INIT_CONNECTION_COMPLETE, + STATE_SSL_CONNECT, + STATE_SSL_CONNECT_COMPLETE, + STATE_WRITE_HEADERS, + STATE_WRITE_HEADERS_COMPLETE, + STATE_WRITE_BODY, + STATE_WRITE_BODY_COMPLETE, + STATE_READ_HEADERS, + STATE_READ_HEADERS_COMPLETE, + STATE_READ_BODY, + STATE_READ_BODY_COMPLETE, + STATE_DRAIN_BODY_FOR_AUTH_RESTART, + STATE_DRAIN_BODY_FOR_AUTH_RESTART_COMPLETE, + STATE_NONE + }; + void DoCallback(int result); void OnIOComplete(int result); @@ -102,10 +125,6 @@ class HttpNetworkTransaction : public HttpTransaction { int DoResolveProxyComplete(int result); int DoInitConnection(); int DoInitConnectionComplete(int result); - int DoResolveHost(); - int DoResolveHostComplete(int result); - int DoTCPConnect(); - int DoTCPConnectComplete(int result); int DoSSLConnect(); int DoSSLConnectComplete(int result); int DoWriteHeaders(); @@ -363,29 +382,7 @@ class HttpNetworkTransaction : public HttpTransaction { // The time the host resolution started (if it indeed got started). base::Time host_resolution_start_time_; - enum State { - STATE_RESOLVE_PROXY, - STATE_RESOLVE_PROXY_COMPLETE, - STATE_INIT_CONNECTION, - STATE_INIT_CONNECTION_COMPLETE, - STATE_RESOLVE_HOST, - STATE_RESOLVE_HOST_COMPLETE, - STATE_TCP_CONNECT, - STATE_TCP_CONNECT_COMPLETE, - STATE_SSL_CONNECT, - STATE_SSL_CONNECT_COMPLETE, - STATE_WRITE_HEADERS, - STATE_WRITE_HEADERS_COMPLETE, - STATE_WRITE_BODY, - STATE_WRITE_BODY_COMPLETE, - STATE_READ_HEADERS, - STATE_READ_HEADERS_COMPLETE, - STATE_READ_BODY, - STATE_READ_BODY_COMPLETE, - STATE_DRAIN_BODY_FOR_AUTH_RESTART, - STATE_DRAIN_BODY_FOR_AUTH_RESTART_COMPLETE, - STATE_NONE - }; + // The next state in the state machine. State next_state_; }; |