summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-02 18:09:14 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-02 18:09:14 +0000
commit2902885a04fa4cc3c9e80eba7f9c55e96a4441dc (patch)
tree98522e5fdf5f8259880151feba1806017ced2533 /net
parentd4651ffb26b0eb01701b01453dcd4479b7ca38eb (diff)
downloadchromium_src-2902885a04fa4cc3c9e80eba7f9c55e96a4441dc.zip
chromium_src-2902885a04fa4cc3c9e80eba7f9c55e96a4441dc.tar.gz
chromium_src-2902885a04fa4cc3c9e80eba7f9c55e96a4441dc.tar.bz2
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
Diffstat (limited to 'net')
-rw-r--r--net/base/tcp_client_socket_libevent.cc2
1 files changed, 2 insertions, 0 deletions
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);
}