summaryrefslogtreecommitdiffstats
path: root/net/socket/tcp_client_socket_win.cc
diff options
context:
space:
mode:
authorcbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-25 09:38:56 +0000
committercbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-25 09:38:56 +0000
commit4a17b67f2da890bc06b78d34be6ede4e0588b150 (patch)
treebd0e375ee6f89e29b1ecdd62c641d82921f90d85 /net/socket/tcp_client_socket_win.cc
parenta25da7eb6713cd8827a8ea562b8568524b73c18f (diff)
downloadchromium_src-4a17b67f2da890bc06b78d34be6ede4e0588b150.zip
chromium_src-4a17b67f2da890bc06b78d34be6ede4e0588b150.tar.gz
chromium_src-4a17b67f2da890bc06b78d34be6ede4e0588b150.tar.bz2
Revert 63648 - Revert 63643 - Add Reset to ClientSocket::UseHistory, and call on TCP disconnect.
The failures which caused me to revert the original looked sporadic. Relanding. The HttpProxyClientSocket reuses the same TcpClientSocket in the case that it is trying to establish a tunnel through an authenticating proxy, but the proxy closed the TCP connection. Also, fix SetOmniboxSpeculation on the TCPClientSocket implementations. BUG=54062 TEST=Tried normal connections to make sure histograms were only emitted once, as well as https tunnels through an authenticating proxy to ensure that the use_history was correctly reset. Review URL: http://codereview.chromium.org/3360007 TBR=cbentzel@chromium.org Review URL: http://codereview.chromium.org/4006004 TBR=cbentzel@chromium.org Review URL: http://codereview.chromium.org/3978008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63716 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/tcp_client_socket_win.cc')
-rw-r--r--net/socket/tcp_client_socket_win.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/net/socket/tcp_client_socket_win.cc b/net/socket/tcp_client_socket_win.cc
index 9143b81..f70d61b 100644
--- a/net/socket/tcp_client_socket_win.cc
+++ b/net/socket/tcp_client_socket_win.cc
@@ -290,8 +290,8 @@ TCPClientSocketWin::TCPClientSocketWin(const AddressList& addresses,
write_callback_(NULL),
next_connect_state_(CONNECT_STATE_NONE),
connect_os_error_(0),
- net_log_(BoundNetLog::Make(net_log, NetLog::SOURCE_SOCKET)) {
-
+ net_log_(BoundNetLog::Make(net_log, NetLog::SOURCE_SOCKET)),
+ previously_disconnected_(false) {
scoped_refptr<NetLog::EventParameters> params;
if (source.is_valid())
params = new NetLogSourceParameter("source_dependency", source);
@@ -364,6 +364,11 @@ int TCPClientSocketWin::DoConnect() {
DCHECK(ai);
DCHECK_EQ(0, connect_os_error_);
+ if (previously_disconnected_) {
+ use_history_.Reset();
+ previously_disconnected_ = false;
+ }
+
net_log_.BeginEvent(NetLog::TYPE_TCP_CONNECT_ATTEMPT,
new NetLogStringParameter(
"address", NetAddressToStringWithPort(current_ai_)));
@@ -478,6 +483,8 @@ void TCPClientSocketWin::DoDisconnect() {
core_->Detach();
core_ = NULL;
+
+ previously_disconnected_ = true;
}
bool TCPClientSocketWin::IsConnected() const {