One missed #ifdef and some comments cleaned up.
BUG=402005
Review URL: https://codereview.chromium.org/571533004
Cr-Commit-Position: refs/heads/master@{#295171}
diff --git a/net/socket/tcp_socket_libevent.cc b/net/socket/tcp_socket_libevent.cc
index f39611b..ae59cd9 100644
--- a/net/socket/tcp_socket_libevent.cc
+++ b/net/socket/tcp_socket_libevent.cc
@@ -605,13 +605,13 @@
return rv;
int flags = 0x20000000; // Magic flag to enable TCP_FASTOPEN.
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_ANDROID)
// sendto() will fail with EPIPE when the system doesn't support TCP Fast
// Open. Theoretically that shouldn't happen since the caller should check
// for system support on startup, but users may dynamically disable TCP Fast
// Open via sysctl.
flags |= MSG_NOSIGNAL;
-#endif // defined(OS_LINUX)
+#endif // defined(OS_LINUX) || defined(OS_ANDROID)
rv = HANDLE_EINTR(sendto(socket_->socket_fd(),
buf->data(),
buf_len,
diff --git a/net/socket/tcp_socket_libevent.h b/net/socket/tcp_socket_libevent.h
index 89b6a22..4cbf692a 100644
--- a/net/socket/tcp_socket_libevent.h
+++ b/net/socket/tcp_socket_libevent.h
@@ -87,49 +87,49 @@
const BoundNetLog& net_log() const { return net_log_; }
private:
- // States that a fast open socket attempt can result in.
+ // States that using a socket with TCP FastOpen can lead to.
enum FastOpenStatus {
FAST_OPEN_STATUS_UNKNOWN,
- // The initial fast open connect attempted returned synchronously,
+ // The initial TCP FastOpen connect attempted returned synchronously,
// indicating that we had and sent a cookie along with the initial data.
FAST_OPEN_FAST_CONNECT_RETURN,
- // The initial fast open connect attempted returned asynchronously,
+ // The initial TCP FastOpen connect attempted returned asynchronously,
// indicating that we did not have a cookie for the server.
FAST_OPEN_SLOW_CONNECT_RETURN,
// Some other error occurred on connection, so we couldn't tell if
- // fast open would have worked.
+ // TCP FastOpen would have worked.
FAST_OPEN_ERROR,
- // An attempt to do a fast open succeeded immediately
+ // An attempt to do a TCP FastOpen succeeded immediately
// (FAST_OPEN_FAST_CONNECT_RETURN) and we later confirmed that the server
// had acked the data we sent.
FAST_OPEN_SYN_DATA_ACK,
- // An attempt to do a fast open succeeded immediately
+ // An attempt to do a TCP FastOpen succeeded immediately
// (FAST_OPEN_FAST_CONNECT_RETURN) and we later confirmed that the server
// had nacked the data we sent.
FAST_OPEN_SYN_DATA_NACK,
- // An attempt to do a fast open succeeded immediately
+ // An attempt to do a TCP FastOpen succeeded immediately
// (FAST_OPEN_FAST_CONNECT_RETURN) and our probe to determine if the
- // socket was using fast open failed.
+ // socket was using TCP FastOpen failed.
FAST_OPEN_SYN_DATA_FAILED,
- // An attempt to do a fast open failed (FAST_OPEN_SLOW_CONNECT_RETURN)
+ // An attempt to do a TCP FastOpen failed (FAST_OPEN_SLOW_CONNECT_RETURN)
// and we later confirmed that the server had acked initial data. This
// should never happen (we didn't send data, so it shouldn't have
// been acked).
FAST_OPEN_NO_SYN_DATA_ACK,
- // An attempt to do a fast open failed (FAST_OPEN_SLOW_CONNECT_RETURN)
+ // An attempt to do a TCP FastOpen failed (FAST_OPEN_SLOW_CONNECT_RETURN)
// and we later discovered that the server had nacked initial data. This
// is the expected case results for FAST_OPEN_SLOW_CONNECT_RETURN.
FAST_OPEN_NO_SYN_DATA_NACK,
- // An attempt to do a fast open failed (FAST_OPEN_SLOW_CONNECT_RETURN)
+ // An attempt to do a TCP FastOpen failed (FAST_OPEN_SLOW_CONNECT_RETURN)
// and our later probe for ack/nack state failed.
FAST_OPEN_NO_SYN_DATA_FAILED,