diff options
author | Sung-jae Park <nicesj.park@samsung.com> | 2013-07-22 23:56:27 +0900 |
---|---|---|
committer | Sung-jae Park <nicesj.park@samsung.com> | 2013-07-23 16:18:41 +0900 |
commit | acc933eea2672942d5d856437801aa5f7c2fd603 (patch) | |
tree | 08ff2cd9dfa9204f57d087b4789faf616f989779 /src | |
parent | 5cf096c3ddde2ef804b6992ecf9b8a6638030d05 (diff) | |
download | com-core-acc933eea2672942d5d856437801aa5f7c2fd603.tar.gz com-core-acc933eea2672942d5d856437801aa5f7c2fd603.tar.bz2 com-core-acc933eea2672942d5d856437801aa5f7c2fd603.zip |
Enable TCP_NODELAY.
Change-Id: I847191cd99c1495b60f9c246a1d453c4ac00ac24
Diffstat (limited to 'src')
-rw-r--r-- | src/com-core_packet-router.c | 2 | ||||
-rw-r--r-- | src/secure_socket.c | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/com-core_packet-router.c b/src/com-core_packet-router.c index 056e0f2..57f45d0 100644 --- a/src/com-core_packet-router.c +++ b/src/com-core_packet-router.c @@ -314,7 +314,7 @@ static inline struct request_ctx *create_request_ctx(int handle) * \NOTE * Running thread: Main */ -static inline struct router *find_router_by_handle(int handle) +static struct router *find_router_by_handle(int handle) { struct dlist *l; struct router *router; diff --git a/src/secure_socket.c b/src/secure_socket.c index 6217bb7..98185c7 100644 --- a/src/secure_socket.c +++ b/src/secure_socket.c @@ -25,6 +25,7 @@ #include <arpa/inet.h> #include <sys/un.h> #include <netinet/in.h> +#include <netinet/tcp.h> #include <errno.h> #include <dlog.h> @@ -109,6 +110,12 @@ EAPI int secure_socket_create_client(const char *peer) DbgPrint("sndbuf: %d\n", sndbuf); } + if (setsockopt(handle, IPPROTO_IP, TCP_NODELAY, &on, sizeof(on)) < 0) { + ErrPrint("Failed to change rcvbuf size: %s\n", strerror(errno)); + } else { + DbgPrint("TCP_NODELAY: %d\n", on); + } + return handle; } @@ -188,6 +195,12 @@ EAPI int secure_socket_get_connection_handle(int server_handle) DbgPrint("sndbuf: %d\n", sndbuf); } + if (setsockopt(handle, IPPROTO_IP, TCP_NODELAY, &on, sizeof(on)) < 0) { + ErrPrint("Failed to change rcvbuf size: %s\n", strerror(errno)); + } else { + DbgPrint("TCP_NODELAY: %d\n", on); + } + return handle; } |