Skip to content

Commit c13ef38

Browse files
committed
Disable Nagle algorithm in addition to TCP_NODELAY
1 parent 9cdfe8c commit c13ef38

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/os.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,11 @@ int tcp_opts(int fd)
344344
int on = 1;
345345

346346
(void) setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (char *) &on, sizeof on);
347+
#ifdef TCP_NODELAY
348+
(void) setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char *) &on, sizeof on);
349+
#endif
347350
#ifdef TCP_QUICKACK
348351
(void) setsockopt(fd, IPPROTO_TCP, TCP_QUICKACK, (char *) &on, sizeof on);
349-
#else
350-
(void) setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char *) &on, sizeof on);
351352
#endif
352353
#ifdef TCP_CONGESTION
353354
(void) setsockopt(fd, IPPROTO_TCP, TCP_CONGESTION, OUTER_CONGESTION_CONTROL_ALG,

0 commit comments

Comments
 (0)