]> granicus.if.org Git - pdns/commitdiff
ixfrdist: fix review comments by @rgacogne
authorPieter Lexis <pieter.lexis@powerdns.com>
Fri, 13 Apr 2018 12:17:45 +0000 (14:17 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Fri, 13 Apr 2018 12:17:45 +0000 (14:17 +0200)
docs/manpages/ixfrdist.1.rst
pdns/ixfrdist.cc

index f01233d790cb366cf12f3447f81963d44519982f..446d0bc859d8f7d1cd36abec6c249d475d1d36c5 100644 (file)
@@ -39,8 +39,8 @@ Options
 --uid <UID>                     Drop effective user-id to *UID* after binding the listen sockets.
 --gid <GID>                     Drop effective group-id to *GID* after binding the listen sockets.
 --axfr-timeout <NUM>            Stop an inbound AXFR when it is not completed in *NUM* seconds. Defaults to 10 seconds.
---tcp-out-threads <NUM>         Amount of worker threads to handle TCP traffic.
-                                This limits the number of concurrent AXFR/IXFR, the default is 10.
+--tcp-in-threads <NUM>          Amount of worker threads to handle TCP traffic from clients.
+                                This limits the number of concurrent AXFR/IXFR sessions, the default is 10.
 
 See also
 --------
index 15217097370e85939a2d537461b7780224e86e16..c93f3d0d946613129145916d7f2c21866194918e 100644 (file)
@@ -580,6 +580,7 @@ void handleTCPRequest(int fd, boost::any&) {
 
   if (saddr == ComboAddress("0.0.0.0", 0)) {
     g_log<<Logger::Warning<<"Could not determine source of message"<<endl;
+    close(cfd);
     return;
   }
 
@@ -641,7 +642,7 @@ void tcpWorker(int tid) {
 
       vector<vector<uint8_t>> packets;
       if (mdp.d_qtype == QType::SOA) {
-      vector<uint8_t> packet;
+        vector<uint8_t> packet;
         bool ret = makeSOAPacket(mdp, packet);
         if (!ret) {
           close(cfd);
@@ -732,7 +733,7 @@ int main(int argc, char** argv) {
       ("work-dir", po::value<string>()->default_value("."), "Directory for storing AXFR and IXFR data")
       ("keep", po::value<uint16_t>()->default_value(KEEP_DEFAULT), "Number of old zone versions to retain")
       ("axfr-timeout", po::value<uint16_t>()->default_value(AXFRTIMEOUT_DEFAULT), "Timeout in seconds for an inbound AXFR to complete")
-      ("tcp-out-threads", po::value<uint16_t>()->default_value(10), "Number of maximum simultaneous outbound TCP connections")
+      ("tcp-in-threads", po::value<uint16_t>()->default_value(10), "Number of maximum simultaneous inbound TCP connections. Limits simultaneous AXFR/IXFR transactions")
       ;
     po::options_description alloptions;
     po::options_description hidden("hidden options");
@@ -933,7 +934,7 @@ int main(int argc, char** argv) {
 
   std::thread ut(updateThread);
   vector<std::thread> tcpHandlers;
-  for (int i = 0; i < g_vm["tcp-out-threads"].as<uint16_t>(); ++i) {
+  for (int i = 0; i < g_vm["tcp-in-threads"].as<uint16_t>(); ++i) {
     tcpHandlers.push_back(std::thread(tcpWorker, i));
   }