| Index: net/tools/flip_server/tcp_socket_util.cc
|
| diff --git a/net/tools/flip_server/tcp_socket_util.cc b/net/tools/flip_server/tcp_socket_util.cc
|
| index 0366b4d97a875cce68814f52ee148467eb75d75c..00f9b7e59e0ad68467d9c2d683e2ed592a4a57bc 100644
|
| --- a/net/tools/flip_server/tcp_socket_util.cc
|
| +++ b/net/tools/flip_server/tcp_socket_util.cc
|
| @@ -17,6 +17,7 @@
|
|
|
| #include "base/files/file_util.h"
|
| #include "base/logging.h"
|
| +#include "net/socket/tcp_socket.h"
|
|
|
| namespace net {
|
|
|
| @@ -61,12 +62,6 @@ bool CloseSocket(int* fd, int tries) {
|
|
|
| } // namespace
|
|
|
| -bool SetTCPNoDelay(int fd) {
|
| - int on = 1;
|
| - return setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, reinterpret_cast<char*>(&on),
|
| - sizeof(on)) == 0;
|
| -}
|
| -
|
| int CreateTCPServerSocket(const std::string& host,
|
| const std::string& port,
|
| bool is_numeric_host_address,
|
| @@ -175,7 +170,7 @@ int CreateTCPServerSocket(const std::string& host,
|
| }
|
|
|
| if (disable_nagle) {
|
| - if (!SetTCPNoDelay(sock)) {
|
| + if (!SetTCPNoDelay(sock, /*no_delay=*/true)) {
|
| close(sock);
|
| LOG(FATAL) << "SetTCPNoDelay() failed on fd: " << sock;
|
| return -1;
|
| @@ -253,7 +248,7 @@ int CreateTCPClientSocket(const std::string& host,
|
| }
|
|
|
| if (disable_nagle) {
|
| - if (!SetTCPNoDelay(sock)) {
|
| + if (!SetTCPNoDelay(sock, /*no_delay=*/true)) {
|
| close(sock);
|
| LOG(FATAL) << "SetTCPNoDelay() failed on fd: " << sock;
|
| return -1;
|
|
|