diff options
author | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-20 03:21:42 +0000 |
---|---|---|
committer | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-20 03:21:42 +0000 |
commit | 4b32be983bb95caa8f79658d0174bff25a9166f6 (patch) | |
tree | 765e650fd36b799b7e3eb3f1ac9d76be55f93526 /net/base | |
parent | b398679efadb644aad24cfec12572fbd19e96e6f (diff) | |
download | chromium_src-4b32be983bb95caa8f79658d0174bff25a9166f6.zip chromium_src-4b32be983bb95caa8f79658d0174bff25a9166f6.tar.gz chromium_src-4b32be983bb95caa8f79658d0174bff25a9166f6.tar.bz2 |
net-internals: Log the addresses that were attempted during a TCP connect, and any OS errors that attempts failed with. This is only for the libevent implementation so far.
BUG=44488
Review URL: http://codereview.chromium.org/2077012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47764 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base')
-rw-r--r-- | net/base/net_log_event_type_list.h | 30 | ||||
-rw-r--r-- | net/base/net_util.cc | 2 |
2 files changed, 30 insertions, 2 deletions
diff --git a/net/base/net_log_event_type_list.h b/net/base/net_log_event_type_list.h index 123d2fd..1c0aedf 100644 --- a/net/base/net_log_event_type_list.h +++ b/net/base/net_log_event_type_list.h @@ -123,9 +123,37 @@ EVENT_TYPE(WAITING_FOR_SINGLE_PROXY_RESOLVER_THREAD) // ClientSocket // ------------------------------------------------------------------------ -// The start/end of a TCP connect(). +// The start/end of a TCP connect(). This corresponds with a call to +// TCPClientSocket::Connect(). +// +// The START event contains these parameters: +// +// { +// "addresses": <List of network address strings> +// } +// +// And the END event will contain the following parameters on failure: +// +// { +// "net_error": <Net integer error code> +// } EVENT_TYPE(TCP_CONNECT) +// Nested within TCP_CONNECT, there may be multiple attempts to connect +// to the individual addresses. The START event will describe the +// address the attempt is for: +// +// { +// "address": <String of the network address> +// } +// +// And the END event will contain the system error code if it failed: +// +// { +// "os_error": <Integer error code the operating system returned> +// } +EVENT_TYPE(TCP_CONNECT_ATTEMPT) + // Marks the destruction of a TCP socket. EVENT_TYPE(TCP_SOCKET_DONE) diff --git a/net/base/net_util.cc b/net/base/net_util.cc index ff0b6af..99b21b8 100644 --- a/net/base/net_util.cc +++ b/net/base/net_util.cc @@ -1185,7 +1185,7 @@ int SetNonBlocking(int fd) { #elif defined(OS_POSIX) int flags = fcntl(fd, F_GETFL, 0); if (-1 == flags) - flags = 0; + return flags; return fcntl(fd, F_SETFL, flags | O_NONBLOCK); #endif } |