diff options
author | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-05 03:06:08 +0000 |
---|---|---|
committer | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-05 03:06:08 +0000 |
commit | d3d828560fe1a18f6b790a470272844e794a7cb4 (patch) | |
tree | 697685d9ea9c729066236e4d1bda1e37a7e3fd04 /net/socket/tcp_client_socket_libevent.cc | |
parent | d406b29c71cc11328fe5c1f12063c3782fbbb3c8 (diff) | |
download | chromium_src-d3d828560fe1a18f6b790a470272844e794a7cb4.zip chromium_src-d3d828560fe1a18f6b790a470272844e794a7cb4.tar.gz chromium_src-d3d828560fe1a18f6b790a470272844e794a7cb4.tar.bz2 |
Map WSAEACCES (which is reported by connect if Windows Firewall
blocks the connection) to ERR_ACCESS_DENIED. We are already
mapping EACCES to ERR_ACCESS_DENIED on Linux and Mac.
Use ERR_CONNECTION_FAILED instead of ERR_FAILED as the default
error code for Connect.
Create the ShouldTryNextAddress function for Windows to match
the Linux and Mac code.
WSAGetLastError returns int rather than DWORD.
R=eroman
BUG=21548
TEST=none
Review URL: http://codereview.chromium.org/361015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31064 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/tcp_client_socket_libevent.cc')
-rw-r--r-- | net/socket/tcp_client_socket_libevent.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/net/socket/tcp_client_socket_libevent.cc b/net/socket/tcp_client_socket_libevent.cc index abf66bc..9d04919 100644 --- a/net/socket/tcp_client_socket_libevent.cc +++ b/net/socket/tcp_client_socket_libevent.cc @@ -74,8 +74,12 @@ int MapConnectError(int err) { switch (err) { case ETIMEDOUT: return ERR_CONNECTION_TIMED_OUT; - default: - return MapPosixError(err); + default: { + int net_error = MapPosixError(err); + if (net_error == ERR_FAILED) + return ERR_CONNECTION_FAILED; // More specific than ERR_FAILED. + return net_error; + } } } |