From d6e39658ae105fca2cfe37ba736dbf0e8d8356af Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Tue, 2 Mar 2021 13:15:35 +0100 Subject: [PATCH] Support TCP_NOPUSH as alternative to TCP_CORK TCP_CORK is a Linux thing and BSD has TCP_NOPUSH instead. --- common/rdr/FdOutStream.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/rdr/FdOutStream.cxx b/common/rdr/FdOutStream.cxx index ed6535a8..3cd86927 100644 --- a/common/rdr/FdOutStream.cxx +++ b/common/rdr/FdOutStream.cxx @@ -74,6 +74,10 @@ void FdOutStream::cork(bool enable) int one = enable ? 1 : 0; setsockopt(fd, IPPROTO_TCP, TCP_CORK, (char *)&one, sizeof(one)); #endif +#ifdef TCP_NOPUSH + int one = enable ? 1 : 0; + setsockopt(fd, IPPROTO_TCP, TCP_NOPUSH, (char *)&one, sizeof(one)); +#endif } bool FdOutStream::flushBuffer() -- 2.39.5