Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1550)

Unified Diff: net/socket/tcp_client_socket_win.cc

Issue 159904: Add a new net::Error value: ERR_CONNECTION_TIMED_OUT. (Closed)
Patch Set: Use MapConnectError() for asynchronous case too. Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/socket/tcp_client_socket_libevent.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/tcp_client_socket_win.cc
diff --git a/net/socket/tcp_client_socket_win.cc b/net/socket/tcp_client_socket_win.cc
index aa0e68cf17a85a4862d435d0d55f27d089482281..de3cac6d26705ea826308c357db5843c1008dbd7 100644
--- a/net/socket/tcp_client_socket_win.cc
+++ b/net/socket/tcp_client_socket_win.cc
@@ -76,6 +76,15 @@ int MapWinsockError(DWORD err) {
}
}
+int MapConnectError(DWORD err) {
+ switch (err) {
+ case WSAETIMEDOUT:
+ return ERR_CONNECTION_TIMED_OUT;
+ default:
+ return MapWinsockError(err);
+ }
+}
+
} // namespace
//-----------------------------------------------------------------------------
@@ -270,7 +279,7 @@ int TCPClientSocketWin::Connect(CompletionCallback* callback) {
DWORD err = WSAGetLastError();
if (err != WSAEWOULDBLOCK) {
LOG(ERROR) << "connect failed: " << err;
- return MapWinsockError(err);
+ return MapConnectError(err);
}
}
@@ -539,7 +548,7 @@ void TCPClientSocketWin::DidCompleteConnect() {
current_ai_ = next;
result = Connect(read_callback_);
} else {
- result = MapWinsockError(error_code);
+ result = MapConnectError(error_code);
}
} else {
NOTREACHED();
« no previous file with comments | « net/socket/tcp_client_socket_libevent.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698