server: Turn off Nagle's algorithm

pull/65/head
Andri Yngvason 2022-07-09 16:29:18 +00:00
parent d86af88573
commit f20ffb5e1e
1 changed files with 4 additions and 0 deletions

View File

@ -45,6 +45,7 @@
#include <sys/socket.h>
#include <sys/un.h>
#include <netdb.h>
#include <netinet/tcp.h>
#ifdef ENABLE_TLS
#include <gnutls/gnutls.h>
@ -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");