From 76f567c75dea00562133598e441da1f07fe2e048 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 3 Feb 2018 09:49:04 +0100 Subject: [PATCH] Enabled TCP no delay --- app/src/main/jni/netguard/tcp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/jni/netguard/tcp.c b/app/src/main/jni/netguard/tcp.c index cb49f36c..dd2d935d 100644 --- a/app/src/main/jni/netguard/tcp.c +++ b/app/src/main/jni/netguard/tcp.c @@ -1026,6 +1026,11 @@ int open_tcp_socket(const struct arguments *args, if (protect_socket(args, sock) < 0) return -1; + int on = 1; + if (setsockopt(sock, SOL_TCP, TCP_NODELAY, &on, sizeof(on)) < 0) + log_android(ANDROID_LOG_ERROR, "setsockopt TCP_NODELAY error %d: %s", + errno, strerror(errno)); + // Set non blocking int flags = fcntl(sock, F_GETFL, 0); if (flags < 0 || fcntl(sock, F_SETFL, flags | O_NONBLOCK) < 0) {