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
#include "rec_channel.hh"
#include <sys/socket.h>
#include <cerrno>
+#include "misc.hh"
#include <string.h>
#include <cstdlib>
#include <unistd.h>
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];