[svn] commit: r3310 - in /branches/trac327/src: bin/auth/auth_srv.cc bin/auth/main.cc bin/auth/tests/auth_srv_unittest.cc bin/auth/tests/mockups.h bin/recurse/main.cc bin/recurse/recursor.cc lib/asiolink/ioaddress.h

BIND 10 source code commits bind10-changes at lists.isc.org
Thu Oct 21 23:10:24 UTC 2010


Author: each
Date: Thu Oct 21 23:10:24 2010
New Revision: 3310

Log:
Addressed more review comments

Modified:
    branches/trac327/src/bin/auth/auth_srv.cc
    branches/trac327/src/bin/auth/main.cc
    branches/trac327/src/bin/auth/tests/auth_srv_unittest.cc
    branches/trac327/src/bin/auth/tests/mockups.h
    branches/trac327/src/bin/recurse/main.cc
    branches/trac327/src/bin/recurse/recursor.cc
    branches/trac327/src/lib/asiolink/ioaddress.h

Modified: branches/trac327/src/bin/auth/auth_srv.cc
==============================================================================
--- branches/trac327/src/bin/auth/auth_srv.cc (original)
+++ branches/trac327/src/bin/auth/auth_srv.cc Thu Oct 21 23:10:24 2010
@@ -78,23 +78,26 @@
                           OutputBufferPtr buffer);
     bool processNotify(const IOMessage& io_message, MessagePtr message, 
                        OutputBufferPtr buffer);
+
+    /// Currently non-configurable, but will be.
+    static const uint16_t DEFAULT_LOCAL_UDPSIZE = 4096;
+
+    /// These members are public because AuthSrv accesses them directly.
+    ModuleCCSession* config_session_;
+    bool verbose_mode_;
+    AbstractSession* xfrin_session_;
+
+private:
     std::string db_file_;
-    ModuleCCSession* config_session_;
+
     MetaDataSrc data_sources_;
     /// We keep a pointer to the currently running sqlite datasource
     /// so that we can specifically remove that one should the database
     /// file change
     ConstDataSrcPtr cur_datasrc_;
 
-    bool verbose_mode_;
-
-    AbstractSession* xfrin_session_;
-
     bool xfrout_connected_;
     AbstractXfroutClient& xfrout_client_;
-
-    /// Currently non-configurable, but will be.
-    static const uint16_t DEFAULT_LOCAL_UDPSIZE = 4096;
 
     /// Hot spot cache
     isc::datasrc::HotCache cache_;

Modified: branches/trac327/src/bin/auth/main.cc
==============================================================================
--- branches/trac327/src/bin/auth/main.cc (original)
+++ branches/trac327/src/bin/auth/main.cc Thu Oct 21 23:10:24 2010
@@ -57,6 +57,7 @@
 
 static bool verbose_mode = false;
 
+// Default port current 5300 for testing purposes
 static const string PROGRAM = "Auth";
 static const char* DNSPORT = "5300";
 
@@ -89,11 +90,13 @@
 
 void
 usage() {
-    cerr << "Usage:  b10-auth [-a address] [-p port] [-4|-6] [-nv]" << endl;
+    cerr << "Usage:  b10-auth [-a address] [-p port] [-u user] [-4|-6] [-nv]"
+         << endl;
     cerr << "\t-a: specify the address to listen on (default: all) " << endl;
-    cerr << "\t-p: specify the port to listen on (default: 5300)" << endl;
+    cerr << "\t-p: specify the port to listen on (default: " << DNSPORT << ")"
+         << endl;
     cerr << "\t-4: listen on all IPv4 addresses (incompatible with -a)" << endl;
-    cerr << "\t-4: listen on all IPv6 addresses (incompatible with -a)" << endl;
+    cerr << "\t-6: listen on all IPv6 addresses (incompatible with -a)" << endl;
     cerr << "\t-n: do not cache answers in memory" << endl;
     cerr << "\t-u: change process UID to the specified user" << endl;
     cerr << "\t-v: verbose output" << endl;

Modified: branches/trac327/src/bin/auth/tests/auth_srv_unittest.cc
==============================================================================
--- branches/trac327/src/bin/auth/tests/auth_srv_unittest.cc (original)
+++ branches/trac327/src/bin/auth/tests/auth_srv_unittest.cc Thu Oct 21 23:10:24 2010
@@ -387,11 +387,11 @@
 
     // An internal command message should have been created and sent to an
     // external module.  Check them.
-    EXPECT_EQ("Zonemgr", notify_session.msg_destination);
+    EXPECT_EQ("Zonemgr", notify_session.getMessageDest());
     EXPECT_EQ("notify",
-              notify_session.sent_msg->get("command")->get(0)->stringValue());
+              notify_session.getSentMessage()->get("command")->get(0)->stringValue());
     ConstElementPtr notify_args =
-        notify_session.sent_msg->get("command")->get(1);
+        notify_session.getSentMessage()->get("command")->get(1);
     EXPECT_EQ("example.com.", notify_args->get("zone_name")->stringValue());
     EXPECT_EQ(DEFAULT_REMOTE_ADDRESS,
               notify_args->get("master")->stringValue());
@@ -420,7 +420,7 @@
     // Other conditions should be the same, so simply confirm the RR class is
     // set correctly.
     ConstElementPtr notify_args =
-        notify_session.sent_msg->get("command")->get(1);
+        notify_session.getSentMessage()->get("command")->get(1);
     EXPECT_EQ("CH", notify_args->get("zone_class")->stringValue());
 }
 

Modified: branches/trac327/src/bin/auth/tests/mockups.h
==============================================================================
--- branches/trac327/src/bin/auth/tests/mockups.h (original)
+++ branches/trac327/src/bin/auth/tests/mockups.h Thu Oct 21 23:10:24 2010
@@ -45,8 +45,8 @@
                       "mock session send is disabled for test");
         }
 
-        sent_msg = msg;
-        msg_destination = group;
+        sent_msg_ = msg;
+        msg_dest_ = group;
         return (0);
     }
 
@@ -83,13 +83,17 @@
     virtual void setTimeout(size_t timeout UNUSED_PARAM) {};
     virtual size_t getTimeout() const { return 0; };
 
+    // The following methods extent AbstractSession to allow testing:
     void setMessage(isc::data::ConstElementPtr msg) { msg_ = msg; }
     void disableSend() { send_ok_ = false; }
     void disableReceive() { receive_ok_ = false; }
 
-    isc::data::ConstElementPtr sent_msg;
-    std::string msg_destination;
+    isc::data::ConstElementPtr getSentMessage() { return (sent_msg_); }
+    std::string getMessageDest() { return (msg_dest_); }
+
 private:
+    isc::data::ConstElementPtr sent_msg_;
+    std::string msg_dest_;
     isc::data::ConstElementPtr msg_;
     bool send_ok_;
     bool receive_ok_;

Modified: branches/trac327/src/bin/recurse/main.cc
==============================================================================
--- branches/trac327/src/bin/recurse/main.cc (original)
+++ branches/trac327/src/bin/recurse/main.cc Thu Oct 21 23:10:24 2010
@@ -59,6 +59,7 @@
 
 static bool verbose_mode = false;
 
+// Default port current 5300 for testing purposes
 static const string PROGRAM = "Recurse";
 static const char* DNSPORT = "5300";
 
@@ -87,14 +88,15 @@
 
 void
 usage() {
-    cerr << "Usage:  b10-recurse -f nameserver [-a address] [-p port] "
+    cerr << "Usage:  b10-recurse -f nameserver [-a address] [-p port] [-u user]"
                      "[-4|-6] [-v]" << endl;
     cerr << "\t-f: specify the nameserver to which queries should be forwarded"
          << endl;
     cerr << "\t-a: specify the address to listen on (default: all)" << endl;
-    cerr << "\t-p: specify the port to listen on (default: 5300)" << endl;
+    cerr << "\t-p: specify the port to listen on (default: " << DNSPORT << ")"
+         << endl;
     cerr << "\t-4: listen on all IPv4 addresses (incompatible with -a)" << endl;
-    cerr << "\t-4: listen on all IPv6 addresses (incompatible with -a)" << endl;
+    cerr << "\t-6: listen on all IPv6 addresses (incompatible with -a)" << endl;
     cerr << "\t-u: change process UID to the specified user" << endl;
     cerr << "\t-v: verbose output" << endl;
     exit(1);

Modified: branches/trac327/src/bin/recurse/recursor.cc
==============================================================================
--- branches/trac327/src/bin/recurse/recursor.cc (original)
+++ branches/trac327/src/bin/recurse/recursor.cc Thu Oct 21 23:10:24 2010
@@ -86,18 +86,19 @@
                             OutputBufferPtr buffer,
                             DNSServer* server);
 
+    /// Currently non-configurable, but will be.
+    static const uint16_t DEFAULT_LOCAL_UDPSIZE = 4096;
+
+    /// These members are public because Recursor accesses them directly.
     ModuleCCSession* config_session_;
-
     bool verbose_mode_;
 
+private:
     /// Address of the forward nameserver
     const char& forward_;
 
     /// Object to handle upstream queries
     RecursiveQuery* rec_query_;
-
-    /// Currently non-configurable, but will be.
-    static const uint16_t DEFAULT_LOCAL_UDPSIZE = 4096;
 };
 
 class QuestionInserter {

Modified: branches/trac327/src/lib/asiolink/ioaddress.h
==============================================================================
--- branches/trac327/src/lib/asiolink/ioaddress.h (original)
+++ branches/trac327/src/lib/asiolink/ioaddress.h Thu Oct 21 23:10:24 2010
@@ -73,7 +73,7 @@
     /// and if it fails the corresponding standard exception will be thrown.
     ///
     /// \return A string representation of the address.
-    std::string toText() const;
+    virtual std::string toText() const;
 
     /// \brief Returns the address family.
     virtual short getFamily() const;




More information about the bind10-changes mailing list