| Index: net/socket/tcp_client_socket_libevent.cc
|
| diff --git a/net/socket/tcp_client_socket_libevent.cc b/net/socket/tcp_client_socket_libevent.cc
|
| index a8e438727e09f276c2d410027bef8f1082b63382..c03473a3767719c5ea80986c43b40b21df04c5df 100644
|
| --- a/net/socket/tcp_client_socket_libevent.cc
|
| +++ b/net/socket/tcp_client_socket_libevent.cc
|
| @@ -67,6 +67,15 @@ int MapPosixError(int err) {
|
| }
|
| }
|
|
|
| +int MapConnectError(int err) {
|
| + switch (err) {
|
| + case ETIMEDOUT:
|
| + return ERR_CONNECTION_TIMED_OUT;
|
| + default:
|
| + return MapPosixError(err);
|
| + }
|
| +}
|
| +
|
| } // namespace
|
|
|
| //-----------------------------------------------------------------------------
|
| @@ -115,7 +124,7 @@ int TCPClientSocketLibevent::Connect(CompletionCallback* callback) {
|
| DLOG(INFO) << "connect failed: " << errno;
|
| close(socket_);
|
| socket_ = kInvalidSocket;
|
| - return MapPosixError(errno);
|
| + return MapConnectError(errno);
|
| }
|
|
|
| // Initialize write_socket_watcher_ and link it to our MessagePump.
|
| @@ -309,7 +318,7 @@ void TCPClientSocketLibevent::DidCompleteConnect() {
|
| current_ai_ = next;
|
| result = Connect(write_callback_);
|
| } else {
|
| - result = MapPosixError(error_code);
|
| + result = MapConnectError(error_code);
|
| bool ok = write_socket_watcher_.StopWatchingFileDescriptor();
|
| DCHECK(ok);
|
| waiting_connect_ = false;
|
|
|