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

Unified Diff: net/socket/tcp_socket_libevent.cc

Issue 185553013: Standardize error reporting of IPEndPoint::ToSockAddr and (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 10 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/stream_listen_socket.cc ('k') | net/socket/tcp_socket_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/tcp_socket_libevent.cc
===================================================================
--- net/socket/tcp_socket_libevent.cc (revision 254575)
+++ net/socket/tcp_socket_libevent.cc (working copy)
@@ -611,9 +611,9 @@
NOTREACHED();
if (IGNORE_EINTR(close(new_socket)) < 0)
PLOG(ERROR) << "close";
- net_log_.EndEventWithNetErrorCode(NetLog::TYPE_TCP_ACCEPT,
- ERR_ADDRESS_INVALID);
- return ERR_ADDRESS_INVALID;
+ int net_error = ERR_ADDRESS_INVALID;
+ net_log_.EndEventWithNetErrorCode(NetLog::TYPE_TCP_ACCEPT, net_error);
+ return net_error;
}
scoped_ptr<TCPSocketLibevent> tcp_socket(new TCPSocketLibevent(
net_log_.net_log(), net_log_.source()));
@@ -639,7 +639,7 @@
if (!use_tcp_fastopen_) {
SockaddrStorage storage;
if (!peer_address_->ToSockAddr(storage.addr, &storage.addr_len))
- return ERR_INVALID_ARGUMENT;
+ return ERR_ADDRESS_INVALID;
if (!HANDLE_EINTR(connect(socket_, storage.addr, storage.addr_len))) {
// Connected without waiting!
@@ -825,7 +825,7 @@
if (use_tcp_fastopen_ && !tcp_fastopen_connected_) {
SockaddrStorage storage;
if (!peer_address_->ToSockAddr(storage.addr, &storage.addr_len)) {
- errno = EINVAL;
wtc 2014/03/04 00:43:28 Setting errno to EINVAL here was apparently an att
eroman 2014/03/04 03:01:10 That is kind of gross
+ errno = EADDRNOTAVAIL;
return -1;
}
« no previous file with comments | « net/socket/stream_listen_socket.cc ('k') | net/socket/tcp_socket_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698