Browse Source

changed random() to rand() for (temporary) server selection
added a missing boost flag in lib/asiolink/tests makefile


git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac327@3902 e5f2f494-b856-4b98-b285-d166d9295462

Jelte Jansen 14 years ago
parent
commit
f7fd282fa1
2 changed files with 3 additions and 2 deletions
  1. 2 2
      src/lib/asiolink/asiolink.cc
  2. 1 0
      src/lib/asiolink/tests/Makefile.am

+ 2 - 2
src/lib/asiolink/asiolink.cc

@@ -16,7 +16,7 @@
 
 #include <config.h>
 
-#include <cstdlib> // For random(), temporary until better forwarding is done
+#include <cstdlib> // For rand(), temporary until better forwarding is done
 
 #include <unistd.h>             // for some IPC/network system calls
 #include <sys/socket.h>
@@ -317,7 +317,7 @@ private:
     void send() {
         const int uc = upstream_->size();
         if (uc > 0) {
-            int serverIndex(random() % uc);
+            int serverIndex = rand() % uc;
             dlog("Sending upstream query (" + question_.toText() +
                 ") to " + upstream_->at(serverIndex).first);
             UDPQuery query(io_, question_,

+ 1 - 0
src/lib/asiolink/tests/Makefile.am

@@ -1,4 +1,5 @@
 AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+AM_CPPFLAGS += $(BOOST_INCLUDES)
 AM_CPPFLAGS += -I$(top_builddir)/src/lib/dns -I$(top_srcdir)/src/bin
 AM_CPPFLAGS += -I$(top_builddir)/src/lib/cc
 AM_CPPFLAGS += -DTEST_DATA_DIR=\"$(srcdir)/testdata\"