]> granicus.if.org Git - pdns/commitdiff
spiff up ipv6 output a bit, work around odd linker things with static constructors
authorBert Hubert <bert.hubert@netherlabs.nl>
Tue, 18 Apr 2006 17:01:32 +0000 (17:01 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Tue, 18 Apr 2006 17:01:32 +0000 (17:01 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@729 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/epollmplexer.cc
pdns/kqueuemplexer.cc
pdns/pdns_recursor.cc

index 62e09e5cfdfcdcaaebac8d4228a4e4ff75706d5d..608d7d8ce6d9f2472e73c9ee056e3a0932d19321 100644 (file)
@@ -39,17 +39,17 @@ private:
 };
 
 
-static FDMultiplexer* make()
+static FDMultiplexer* makeEpoll()
 {
   return new EpollFDMultiplexer();
 }
 
-static struct RegisterOurselves
+static struct EpollRegisterOurselves
 {
-  RegisterOurselves() {
-    FDMultiplexer::getMultiplexerMap().insert(make_pair(0, &make)); // priority 0!
+  EpollRegisterOurselves() {
+    FDMultiplexer::getMultiplexerMap().insert(make_pair(0, &makeEpoll)); // priority 0!
   }
-} doIt;
+} doItEpoll;
 
 
 int EpollFDMultiplexer::s_maxevents=1024;
index 1a3ab060fc2bea1f2cbdffa1998beed508e57406..0f1ccb1220471d2f99a3a53254dbdb2543f68809 100644 (file)
@@ -44,12 +44,12 @@ static FDMultiplexer* make()
   return new KqueueFDMultiplexer();
 }
 
-static struct RegisterOurselves
+static struct KqueueRegisterOurselves
 {
-  RegisterOurselves() {
+  KqueueRegisterOurselves() {
     FDMultiplexer::getMultiplexerMap().insert(make_pair(0, &make)); // priority 0!
   }
-} doIt;
+} kQueuedoIt;
 
 KqueueFDMultiplexer::KqueueFDMultiplexer() : d_kevents(new struct kevent[s_maxevents])
 {
index 3873c01ccd23ebb12fa5f88e845c06ed82cf1d7b..8ee195ec0dc29ebead145db9fc29c5739bb7ff92 100644 (file)
@@ -743,7 +743,10 @@ void makeTCPServerSockets()
     setSendBuffer(fd, 65000);
     listen(fd, 128);
     g_fdm->addReadFD(fd, handleNewTCPQuestion);
-    L<<Logger::Error<<"Listening for TCP queries on "<< sockAddrToString(&sin.sin4) <<":"<<::arg().asNum("local-port")<<endl;
+    if(sin.sin4.sin_family == AF_INET) 
+      L<<Logger::Error<<"Listening for TCP queries on "<< sin.toString() <<":"<<::arg().asNum("local-port")<<endl;
+    else
+      L<<Logger::Error<<"Listening for TCP queries on ["<< sin.toString() <<"]:"<<::arg().asNum("local-port")<<endl;
   }
 }
 
@@ -820,7 +823,10 @@ void makeUDPServerSockets()
     Utility::setNonBlocking(fd);
     g_fdm->addReadFD(fd, handleNewUDPQuestion);
     g_tcpListenSockets.push_back(fd);
-    L<<Logger::Error<<"Listening for UDP queries on "<<sin.toString()<<":"<<::arg().asNum("local-port")<<endl;
+    if(sin.sin4.sin_family == AF_INET) 
+      L<<Logger::Error<<"Listening for UDP queries on "<< sin.toString() <<":"<<::arg().asNum("local-port")<<endl;
+    else
+      L<<Logger::Error<<"Listening for UDP queries on ["<< sin.toString() <<"]:"<<::arg().asNum("local-port")<<endl;
   }
 }