summaryrefslogtreecommitdiffstats
path: root/net/socket/socks5_client_socket.cc
diff options
context:
space:
mode:
authormbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-25 06:23:00 +0000
committermbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-25 06:23:00 +0000
commit76a505b0776481b4bb2ec41969c8c9dcefd6e2a2 (patch)
treee7dd53d4e8f5897815df364e9f1248a87646eccf /net/socket/socks5_client_socket.cc
parent2b6ed3dc5fc23bdadbd5052f896648d2d62b9ca2 (diff)
downloadchromium_src-76a505b0776481b4bb2ec41969c8c9dcefd6e2a2.zip
chromium_src-76a505b0776481b4bb2ec41969c8c9dcefd6e2a2.tar.gz
chromium_src-76a505b0776481b4bb2ec41969c8c9dcefd6e2a2.tar.bz2
Fix a crash where we are checking IsConnected(). If you look into the
implementation of IsConnected() on windows, you'll find that it can synchronously check if the socket is connected. This makes it so that a CHECK (or DCHECK) on this attribute is dependent on the peer. The peer could send us a TCP-FIN at any time - even 1 nanosecond before our call to IsConnected(). We can only use CHECK(!IsConnected()) to check before we connect, we simply can't use it at runtime. I searched the code and found 4 other instances of this broken check. Most were DCHECKs, which is good, but I've removed them just the same. Turns out our MockSockets have a mechanism for simulating this error, but it wasn't tested nor plumbed through the MockSSLClientSocket. In the process I added a couple of basic proxy test cases, which may be slightly redundant with other test cases that are more advanced. But they seem like a good idea to cover anyway. Added 6 tests in total. BUG=53099 TEST=ProxyTunnelGetHangup, RecycleDeadSSLSocket Review URL: http://codereview.chromium.org/3107036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57295 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/socks5_client_socket.cc')
-rw-r--r--net/socket/socks5_client_socket.cc1
1 files changed, 0 insertions, 1 deletions
diff --git a/net/socket/socks5_client_socket.cc b/net/socket/socks5_client_socket.cc
index 997fb25..9c9ecbe 100644
--- a/net/socket/socks5_client_socket.cc
+++ b/net/socket/socks5_client_socket.cc
@@ -67,7 +67,6 @@ SOCKS5ClientSocket::~SOCKS5ClientSocket() {
int SOCKS5ClientSocket::Connect(CompletionCallback* callback) {
DCHECK(transport_.get());
DCHECK(transport_->socket());
- DCHECK(transport_->socket()->IsConnected());
DCHECK_EQ(STATE_NONE, next_state_);
DCHECK(!user_callback_);