mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-10-29 04:03:45 +00:00
remove tcp_nodelay
This commit is contained in:
+2
-5
@@ -154,7 +154,6 @@ int create_and_bind(const char *addr, const char *port)
|
||||
|
||||
int opt = 1;
|
||||
setsockopt(listen_sock, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));
|
||||
setsockopt(listen_sock, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt));
|
||||
#ifdef SO_NOSIGPIPE
|
||||
setsockopt(listen_sock, SOL_SOCKET, SO_NOSIGPIPE, &opt, sizeof(opt));
|
||||
#endif
|
||||
@@ -793,7 +792,6 @@ static void close_and_free_server(EV_P_ struct server *server)
|
||||
static struct remote * connect_to_remote(struct listen_ctx *listener,
|
||||
const char *host, const char *port)
|
||||
{
|
||||
int opt = 1;
|
||||
int sockfd;
|
||||
struct addrinfo *remote_res;
|
||||
|
||||
@@ -829,8 +827,8 @@ static struct remote * connect_to_remote(struct listen_ctx *listener,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt));
|
||||
#ifdef SO_NOSIGPIPE
|
||||
int opt = 1;
|
||||
setsockopt(sockfd, SOL_SOCKET, SO_NOSIGPIPE, &opt, sizeof(opt));
|
||||
#endif
|
||||
|
||||
@@ -868,9 +866,8 @@ void accept_cb(EV_P_ ev_io *w, int revents)
|
||||
return;
|
||||
}
|
||||
setnonblocking(serverfd);
|
||||
int opt = 1;
|
||||
setsockopt(serverfd, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt));
|
||||
#ifdef SO_NOSIGPIPE
|
||||
int opt = 1;
|
||||
setsockopt(serverfd, SOL_SOCKET, SO_NOSIGPIPE, &opt, sizeof(opt));
|
||||
#endif
|
||||
|
||||
|
||||
@@ -127,7 +127,6 @@ int create_and_bind(const char *addr, const char *port)
|
||||
|
||||
int opt = 1;
|
||||
setsockopt(listen_sock, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));
|
||||
setsockopt(listen_sock, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt));
|
||||
#ifdef SO_NOSIGPIPE
|
||||
setsockopt(listen_sock, SOL_SOCKET, SO_NOSIGPIPE, &opt, sizeof(opt));
|
||||
#endif
|
||||
@@ -589,7 +588,6 @@ static void accept_cb(EV_P_ ev_io *w, int revents)
|
||||
|
||||
setnonblocking(clientfd);
|
||||
int opt = 1;
|
||||
setsockopt(clientfd, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt));
|
||||
#ifdef SO_NOSIGPIPE
|
||||
setsockopt(clientfd, SOL_SOCKET, SO_NOSIGPIPE, &opt, sizeof(opt));
|
||||
#endif
|
||||
@@ -615,7 +613,6 @@ static void accept_cb(EV_P_ ev_io *w, int revents)
|
||||
return;
|
||||
}
|
||||
|
||||
setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt));
|
||||
#ifdef SO_NOSIGPIPE
|
||||
setsockopt(sockfd, SOL_SOCKET, SO_NOSIGPIPE, &opt, sizeof(opt));
|
||||
#endif
|
||||
|
||||
+2
-5
@@ -154,7 +154,6 @@ int create_and_bind(const char *host, const char *port)
|
||||
|
||||
int opt = 1;
|
||||
setsockopt(listen_sock, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));
|
||||
setsockopt(listen_sock, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt));
|
||||
#ifdef SO_NOSIGPIPE
|
||||
setsockopt(listen_sock, SOL_SOCKET, SO_NOSIGPIPE, &opt, sizeof(opt));
|
||||
#endif
|
||||
@@ -198,7 +197,6 @@ static struct remote *connect_to_remote(struct addrinfo *res,
|
||||
struct server *server)
|
||||
{
|
||||
int sockfd;
|
||||
int opt = 1;
|
||||
#ifdef SET_INTERFACE
|
||||
const char *iface = server->listen_ctx->iface;
|
||||
#endif
|
||||
@@ -211,8 +209,8 @@ static struct remote *connect_to_remote(struct addrinfo *res,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt));
|
||||
#ifdef SO_NOSIGPIPE
|
||||
int opt = 1;
|
||||
setsockopt(sockfd, SOL_SOCKET, SO_NOSIGPIPE, &opt, sizeof(opt));
|
||||
#endif
|
||||
|
||||
@@ -889,9 +887,8 @@ static void accept_cb(EV_P_ ev_io *w, int revents)
|
||||
}
|
||||
setnonblocking(serverfd);
|
||||
|
||||
int opt = 1;
|
||||
setsockopt(serverfd, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt));
|
||||
#ifdef SO_NOSIGPIPE
|
||||
int opt = 1;
|
||||
setsockopt(serverfd, SOL_SOCKET, SO_NOSIGPIPE, &opt, sizeof(opt));
|
||||
#endif
|
||||
|
||||
|
||||
+1
-4
@@ -131,7 +131,6 @@ int create_and_bind(const char *addr, const char *port)
|
||||
|
||||
int opt = 1;
|
||||
setsockopt(listen_sock, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));
|
||||
setsockopt(listen_sock, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt));
|
||||
#ifdef SO_NOSIGPIPE
|
||||
setsockopt(listen_sock, SOL_SOCKET, SO_NOSIGPIPE, &opt, sizeof(opt));
|
||||
#endif
|
||||
@@ -573,9 +572,8 @@ static void accept_cb(EV_P_ ev_io *w, int revents)
|
||||
return;
|
||||
}
|
||||
setnonblocking(serverfd);
|
||||
int opt = 1;
|
||||
setsockopt(serverfd, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt));
|
||||
#ifdef SO_NOSIGPIPE
|
||||
int opt = 1;
|
||||
setsockopt(serverfd, SOL_SOCKET, SO_NOSIGPIPE, &opt, sizeof(opt));
|
||||
#endif
|
||||
|
||||
@@ -603,7 +601,6 @@ static void accept_cb(EV_P_ ev_io *w, int revents)
|
||||
return;
|
||||
}
|
||||
|
||||
setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt));
|
||||
#ifdef SO_NOSIGPIPE
|
||||
setsockopt(sockfd, SOL_SOCKET, SO_NOSIGPIPE, &opt, sizeof(opt));
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user