From f20ffb5e1efe9588cef8c3578e8a3fe362aa4c78 Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Sat, 9 Jul 2022 16:29:18 +0000 Subject: [PATCH] server: Turn off Nagle's algorithm --- src/server.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/server.c b/src/server.c index 9d67876..285639f 100644 --- a/src/server.c +++ b/src/server.c @@ -45,6 +45,7 @@ #include #include #include +#include #ifdef ENABLE_TLS #include @@ -1113,6 +1114,9 @@ static void on_connection(void* obj) goto accept_failure; } + int one = 1; + setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &one, sizeof(one)); + client->net_stream = stream_new(fd, on_client_event, client); if (!client->net_stream) { nvnc_log(NVNC_LOG_WARNING, "OOM");