aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2025-08-29 22:21:14 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2025-08-29 22:21:14 +0000
commit2a2458f746c888aa49c50d3a1c7ab2e978729c2d (patch)
treef1aab6384eeeafaa2209927e9c48ccece74af770
parent1679a62c2cd2cdfed10a0f699cbc29e123dcb4e2 (diff)
downloadtipidee-2a2458f746c888aa49c50d3a1c7ab2e978729c2d.tar.gz
set/clear Nagle depending on realtime only
-rw-r--r--src/tipideed/stream.c2
-rw-r--r--src/tipideed/tipideed.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/tipideed/stream.c b/src/tipideed/stream.c
index 917b0e0..5d368b2 100644
--- a/src/tipideed/stream.c
+++ b/src/tipideed/stream.c
@@ -109,12 +109,10 @@ void stream_infinite (int fd, char const *fn, uint32_t flags)
void cork (int fd)
{
- socket_tcpdelay(fd) ;
}
void uncork (int fd)
{
- socket_tcpnodelay(fd) ;
}
void stream_fixed (int fd, uint64_t n, char const *fn, uint32_t flags)
diff --git a/src/tipideed/tipideed.c b/src/tipideed/tipideed.c
index 6cfd4ec..37e93b2 100644
--- a/src/tipideed/tipideed.c
+++ b/src/tipideed/tipideed.c
@@ -23,6 +23,7 @@
#include <skalibs/sig.h>
#include <skalibs/stat.h>
#include <skalibs/stralloc.h>
+#include <skalibs/socket.h>
#include <skalibs/djbunix.h>
#include <skalibs/avltreen.h>
#include <skalibs/unix-timed.h>
@@ -301,6 +302,9 @@ static inline int serve (tipidee_rql *rql, char const *docroot, char *uribuf, ti
if (rql->m == TIPIDEE_METHOD_OPTIONS)
return respond_options(rql, 2 | !!(ra.flags & TIPIDEE_RA_FLAG_CGI)) ;
+ if (ra.flags & TIPIDEE_RA_FLAG_REALTIME) socket_tcpnodelay(1) ;
+ else socket_tcpdelay(1) ;
+
tipidee_log_resource(g.logv, rql, fn, &ra, infopath) ;
if (g.tarpit) millisleep(g.tarpit) ;