]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Simplify TCP client thread initialization
authorRon Lauren Hombre <118486316+ronhombre@users.noreply.github.com>
Tue, 7 Apr 2026 13:48:26 +0000 (21:48 +0800)
committerGitHub <noreply@github.com>
Tue, 7 Apr 2026 13:48:26 +0000 (21:48 +0800)
Removed conditional TCP client thread creation and make them the default for definition USE_SINGLE_ACCEPTOR_THREAD

Signed-off-by: Ron Lauren Hombre <118486316+ronhombre@users.noreply.github.com>
pdns/dnsdistdist/dnsdist.cc

index 25baf78f8e1bd354050a47cac5bf21aac4a0a8f2..dac9ee6418369ddb447cc870f94629edb7d7e72a 100644 (file)
@@ -3540,19 +3540,9 @@ static void startFrontends()
     std::thread udpThreadHandle(udpClientThread, udpStates);
     udpThreadHandle.detach();
   }
-     
-  /* Gives a TCP Thread to DoQ or DoH3 for cross-protocol communication when a request is too big for dnsdist to use UDP so it uses TCP instead */
-  bool needsTCP = !tcpStates.empty();
-  for (const auto& clientState : dnsdist::getFrontends()) {
-     if (clientState->doqFrontend != nullptr || clientState->doh3Frontend != nullptr) {
-        needsTCP = true;
-        break;
-     }
-  }
-     
-  if (needsTCP) {
-    g_tcpclientthreads = std::make_unique<TCPClientCollection>(1, tcpStates);
-  }
+
+  /* Gives TCP client threads by default */
+  g_tcpclientthreads = std::make_unique<TCPClientCollection>(1, tcpStates);
 #endif /* USE_SINGLE_ACCEPTOR_THREAD */
 }
 }