]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: In single acceptor mode, make the TCP accept socket non-blocking
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 19 Sep 2022 13:20:37 +0000 (15:20 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 30 Sep 2022 14:15:44 +0000 (16:15 +0200)
In theory we should only be waken up if there is a connection to
accept, but let's make sure we don't block if there ever is a
spurious wake-up event.

pdns/dnsdist-tcp.cc

index 2ac8bf88c822719d3a3c0269c4a0c97c2ad666e0..c9f4120b7720c7f0ab04896e7b11e0d6f6d1c49d 100644 (file)
@@ -1305,6 +1305,7 @@ static void tcpClientThread(int pipefd, int crossProtocolQueriesPipeFD, int cros
 
     for (size_t idx = 0; idx < acceptParams.size(); idx++) {
       const auto& param = acceptParams.at(idx);
+      setNonBlocking(param.socket);
       data.mplexer->addReadFD(param.socket, acceptCallback, &param);
     }