From 2902885a04fa4cc3c9e80eba7f9c55e96a4441dc Mon Sep 17 00:00:00 2001 From: "agl@chromium.org" Date: Tue, 2 Dec 2008 18:09:14 +0000 Subject: Linux: fix layout test crash for security/block-test.html. If a connection fails without EINPROGRESS then we don't close the socket right away, but wait until the destructor calls Disconnect(). However, Disconnect assumes that we managed to setup the libevent handle, which is that case we didn't, and crashes on an assert. Review URL: http://codereview.chromium.org/12648 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6223 0039d316-1c4b-4281-b951-d872f2087c98 --- net/base/tcp_client_socket_libevent.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/base/tcp_client_socket_libevent.cc b/net/base/tcp_client_socket_libevent.cc index 2bf3f8d..79909c20 100644 --- a/net/base/tcp_client_socket_libevent.cc +++ b/net/base/tcp_client_socket_libevent.cc @@ -101,6 +101,8 @@ int TCPClientSocket::Connect(CompletionCallback* callback) { if (errno != EINPROGRESS) { DLOG(INFO) << "connect failed: " << errno; + close(socket_); + socket_ = kInvalidSocket; return MapPosixError(errno); } -- cgit v1.1