]> granicus.if.org Git - pdns/commitdiff
ixfrdist: use pollmplexer instead of selectmplexer
authorPieter Lexis <pieter.lexis@powerdns.com>
Fri, 26 Jan 2018 10:18:58 +0000 (11:18 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Mon, 29 Jan 2018 08:20:16 +0000 (09:20 +0100)
pdns/Makefile.am
pdns/ixfrdist.cc

index 738d818736d5e0cd4aba2908d1f75185da002fdd..b8fa57294f7b2e9dbf0bf3d85ded397d97ff2f6d 100644 (file)
@@ -612,7 +612,7 @@ ixfrdist_SOURCES = \
        qtype.cc \
        rcpgenerator.cc rcpgenerator.hh \
        resolver.cc \
-       selectmplexer.cc \
+       pollmplexer.cc \
        sillyrecords.cc \
        sstuff.hh \
        statbag.cc \
index 0b49217cf6a25515cd5418263662ba8911691bfe..d5400fe7e9556c11ed6e55c7a46306805367c5b7 100644 (file)
@@ -50,7 +50,7 @@ ArgvMap &arg()
 
 
 // For all the listen-sockets
-SelectFDMultiplexer g_fdm;
+FDMultiplexer* g_fdm;
 
 // The domains we support
 set<DNSName> g_domains;
@@ -761,6 +761,12 @@ int main(int argc, char** argv) {
     }
   }
 
+  g_fdm = FDMultiplexer::getMultiplexerSilent();
+  if (g_fdm == nullptr) {
+    cerr<<"[ERROR] Could not enable a multiplexer for the listen sockets!"<<endl;
+    return EXIT_FAILURE;
+  }
+
   set<int> allSockets;
   for (const auto& addr : listen_addresses) {
     for (const auto& stype : {SOCK_DGRAM, SOCK_STREAM}) {
@@ -772,7 +778,7 @@ int main(int argc, char** argv) {
         if (stype == SOCK_STREAM) {
           SListen(s, 30); // TODO make this configurable
         }
-        g_fdm.addReadFD(s, stype == SOCK_DGRAM ? handleUDPRequest : handleTCPRequest);
+        g_fdm->addReadFD(s, stype == SOCK_DGRAM ? handleUDPRequest : handleTCPRequest);
         allSockets.insert(s);
       } catch(runtime_error &e) {
         cerr<<"[ERROR] "<<e.what()<<endl;
@@ -807,7 +813,7 @@ int main(int argc, char** argv) {
   struct timeval now;
   for(;;) {
     gettimeofday(&now, 0);
-    g_fdm.run(&now);
+    g_fdm->run(&now);
     if (g_exiting) {
       if (g_verbose) {
         cerr<<"[INFO] Shutting down!"<<endl;