commit 2f471cb77188c26788e6b66f19f612d0b3f68968
parent eaa14b564fd998ac150800c58585a72e8a35bb67
Author: Robin Bron <robin.bron@yourhosting.nl>
Date: Fri, 6 Mar 2026 17:50:54 +0100
Ensure nodelay on client sockets
Diffstat:
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
@@ -7,7 +7,7 @@ SRC:=
# UNAME_SYSTEM=$(call lc,$(shell uname -s))
BIN?=udphole
-VERSION?=1.3.6
+VERSION?=1.3.7
CC:=gcc
CPP:=g++
diff --git a/src/interface/api/server.c b/src/interface/api/server.c
@@ -14,6 +14,7 @@
#include <fcntl.h>
#include <netdb.h>
#include <netinet/in.h>
+#include <netinet/tcp.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -473,6 +474,9 @@ static void handle_accept(int ready_fd) {
if (fd < 0) return;
set_socket_nonblocking(fd, 1);
+ int flag = 1;
+ setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &flag, sizeof(flag));
+
api_client_t *state = calloc(1, sizeof(*state));
if (!state) {
const char *msg = "-ERR out of memory\r\n";