Commit 23fdae2a authored by jri's avatar jri Committed by Commit bot

One missed #ifdef and some comments cleaned up.

BUG=402005

Review URL: https://codereview.chromium.org/571533004

Cr-Commit-Position: refs/heads/master@{#295171}
parent 18d64fc1
...@@ -605,13 +605,13 @@ int TCPSocketLibevent::TcpFastOpenWrite( ...@@ -605,13 +605,13 @@ int TCPSocketLibevent::TcpFastOpenWrite(
return rv; return rv;
int flags = 0x20000000; // Magic flag to enable TCP_FASTOPEN. 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 // sendto() will fail with EPIPE when the system doesn't support TCP Fast
// Open. Theoretically that shouldn't happen since the caller should check // Open. Theoretically that shouldn't happen since the caller should check
// for system support on startup, but users may dynamically disable TCP Fast // for system support on startup, but users may dynamically disable TCP Fast
// Open via sysctl. // Open via sysctl.
flags |= MSG_NOSIGNAL; flags |= MSG_NOSIGNAL;
#endif // defined(OS_LINUX) #endif // defined(OS_LINUX) || defined(OS_ANDROID)
rv = HANDLE_EINTR(sendto(socket_->socket_fd(), rv = HANDLE_EINTR(sendto(socket_->socket_fd(),
buf->data(), buf->data(),
buf_len, buf_len,
......
...@@ -87,49 +87,49 @@ class NET_EXPORT TCPSocketLibevent { ...@@ -87,49 +87,49 @@ class NET_EXPORT TCPSocketLibevent {
const BoundNetLog& net_log() const { return net_log_; } const BoundNetLog& net_log() const { return net_log_; }
private: private:
// States that a fast open socket attempt can result in. // States that using a socket with TCP FastOpen can lead to.
enum FastOpenStatus { enum FastOpenStatus {
FAST_OPEN_STATUS_UNKNOWN, 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. // indicating that we had and sent a cookie along with the initial data.
FAST_OPEN_FAST_CONNECT_RETURN, 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. // indicating that we did not have a cookie for the server.
FAST_OPEN_SLOW_CONNECT_RETURN, FAST_OPEN_SLOW_CONNECT_RETURN,
// Some other error occurred on connection, so we couldn't tell if // 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, 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 // (FAST_OPEN_FAST_CONNECT_RETURN) and we later confirmed that the server
// had acked the data we sent. // had acked the data we sent.
FAST_OPEN_SYN_DATA_ACK, 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 // (FAST_OPEN_FAST_CONNECT_RETURN) and we later confirmed that the server
// had nacked the data we sent. // had nacked the data we sent.
FAST_OPEN_SYN_DATA_NACK, 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 // (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, 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 // 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 // should never happen (we didn't send data, so it shouldn't have
// been acked). // been acked).
FAST_OPEN_NO_SYN_DATA_ACK, 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 // and we later discovered that the server had nacked initial data. This
// is the expected case results for FAST_OPEN_SLOW_CONNECT_RETURN. // is the expected case results for FAST_OPEN_SLOW_CONNECT_RETURN.
FAST_OPEN_NO_SYN_DATA_NACK, 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. // and our later probe for ack/nack state failed.
FAST_OPEN_NO_SYN_DATA_FAILED, FAST_OPEN_NO_SYN_DATA_FAILED,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment