diff options
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -17,11 +17,13 @@ #include <errno.h> #include <netinet/in.h> +#include <netinet/tcp.h> #include <signal.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <sys/socket.h> #include <unistd.h> #include "capture.h" @@ -228,6 +230,11 @@ static void OnClientConnecting(void* user) { return; } + if (setsockopt(client_fd, IPPROTO_TCP, TCP_NODELAY, &(int){1}, sizeof(int))) { + LOG("Failed to set TCP_NODELAY (%s)", strerror(errno)); + goto drop_client; + } + contexts->client_fd = client_fd; if (!IoMuxerOnRead(&contexts->io_muxer, contexts->client_fd, &OnClientWriting, user)) { |