From: Otto Moerbeek Date: Mon, 4 Jul 2022 14:19:01 +0000 (+0200) Subject: Set TCP_NODELAY on in and outgoing TCP X-Git-Tag: auth-4.8.0-alpha0~25^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F11754%2Fhead;p=thirdparty%2Fpdns.git Set TCP_NODELAY on in and outgoing TCP --- diff --git a/pdns/lwres.cc b/pdns/lwres.cc index ba064ec26b..c8f2ce2c0d 100644 --- a/pdns/lwres.cc +++ b/pdns/lwres.cc @@ -261,6 +261,7 @@ static bool tcpconnect(const struct timeval& now, const ComboAddress& ip, TCPOut const struct timeval timeout{ g_networkTimeoutMsec / 1000, static_cast(g_networkTimeoutMsec) % 1000 * 1000}; Socket s(ip.sin4.sin_family, SOCK_STREAM); s.setNonBlocking(); + setTCPNoDelay(s.getHandle()); ComboAddress localip = pdns::getQueryLocalAddress(ip.sin4.sin_family, 0); s.bind(localip); diff --git a/pdns/recursordist/rec-tcp.cc b/pdns/recursordist/rec-tcp.cc index d15fa64d13..f395239555 100644 --- a/pdns/recursordist/rec-tcp.cc +++ b/pdns/recursordist/rec-tcp.cc @@ -654,6 +654,7 @@ void handleNewTCPQuestion(int fd, FDMultiplexer::funcparam_t&) } setNonBlocking(newsock); + setTCPNoDelay(newsock); std::shared_ptr tc = std::make_shared(newsock, addr); tc->d_source = addr; tc->d_destination.reset();