]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Set TCP_NODELAY on in and outgoing TCP 11754/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 4 Jul 2022 14:19:01 +0000 (16:19 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 5 Jul 2022 07:02:42 +0000 (09:02 +0200)
pdns/lwres.cc
pdns/recursordist/rec-tcp.cc

index ba064ec26b2ba9cbc0e7d31d1308568c1ce09674..c8f2ce2c0de7f7a41c6b2edbe85a043c7422f90b 100644 (file)
@@ -261,6 +261,7 @@ static bool tcpconnect(const struct timeval& now, const ComboAddress& ip, TCPOut
   const struct timeval timeout{ g_networkTimeoutMsec / 1000, static_cast<suseconds_t>(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);
 
index d15fa64d13ed201ddd90c0ae548b9a3e9457051f..f395239555616c3a514e105b450dfbb838f9197d 100644 (file)
@@ -654,6 +654,7 @@ void handleNewTCPQuestion(int fd, FDMultiplexer::funcparam_t&)
     }
 
     setNonBlocking(newsock);
+    setTCPNoDelay(newsock);
     std::shared_ptr<TCPConnection> tc = std::make_shared<TCPConnection>(newsock, addr);
     tc->d_source = addr;
     tc->d_destination.reset();