]> granicus.if.org Git - pdns/commitdiff
remove duplicate & *wrong* waitForData() implementation from rec_channel - could...
authorBert Hubert <bert.hubert@netherlabs.nl>
Thu, 29 Jul 2010 11:46:19 +0000 (11:46 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Thu, 29 Jul 2010 11:46:19 +0000 (11:46 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1675 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/Makefile-recursor
pdns/rec_channel.cc

index dc8fa8f5b843c9691d1ad528a084ebeaa142abaa..aec2833d96f0820e9536c2241906d5b88ae33963 100644 (file)
@@ -21,7 +21,8 @@ rec_channel.o rec_channel_rec.o selectmplexer.o sillyrecords.o \
 dns_random.o aescrypt.o aeskey.o aes_modes.o aestab.o lua-pdns-recursor.o \
 randomhelper.o recpacketcache.o dns.o reczones.o base32.o nsecrecords.o
 
-REC_CONTROL_OBJECTS=rec_channel.o rec_control.o arguments.o 
+REC_CONTROL_OBJECTS=rec_channel.o rec_control.o arguments.o misc.o \
+       unix_utility.o logger.o qtype.o
 
 # what we need 
 all: message pdns_recursor rec_control 
index 34d09d88ed5bdaec6ccedf2c26c23f0d894d5f6d..78e1c9bf5994c5064d003a7258fc53ed911a4ab0 100644 (file)
@@ -1,6 +1,7 @@
 #include "rec_channel.hh"
 #include <sys/socket.h>
 #include <cerrno>
+#include "misc.hh"
 #include <string.h>
 #include <cstdlib>
 #include <unistd.h>
@@ -121,27 +122,6 @@ void RecursorControlChannel::send(const std::string& msg, const std::string* rem
     throw AhuException("Unable to send message over control channel: "+string(strerror(errno)));
 }
 
-// returns -1 in case if error, 0 if no data is available, 1 if there is. In the first two cases, errno is set
-static int waitForData(int fd, int seconds, int useconds)
-{
-  struct timeval tv;
-  int ret;
-
-  tv.tv_sec   = seconds;
-  tv.tv_usec  = useconds;
-
-  fd_set readfds;
-  FD_ZERO( &readfds );
-  FD_SET( fd, &readfds );
-
-  ret = select( fd + 1, &readfds, NULL, NULL, (seconds + useconds) ? &tv : 0 );
-  if ( ret == 0 )
-    errno = ETIMEDOUT;
-
-  return ret;
-}
-
-
 string RecursorControlChannel::recv(std::string* remote, unsigned int timeout)
 {
   char buffer[16384];