Browse Source

- renamed a variable: s/is_axfr_connection_established/xfrout_connected/ as suggested in review
- commented on how a customized AbstractXfroutClient object is used


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

JINMEI Tatuya 14 years ago
parent
commit
dc0e2cde2a
2 changed files with 15 additions and 8 deletions
  1. 8 8
      src/bin/auth/auth_srv.cc
  2. 7 0
      src/bin/auth/auth_srv.h

+ 8 - 8
src/bin/auth/auth_srv.cc

@@ -92,7 +92,7 @@ public:
 
     AbstractSession* xfrin_session_;
 
-    bool is_axfr_connection_established_;
+    bool xfrout_connected_;
     AbstractXfroutClient& xfrout_client_;
 
     /// Currently non-configurable, but will be.
@@ -106,7 +106,7 @@ AuthSrvImpl::AuthSrvImpl(const bool use_cache,
                          AbstractXfroutClient& xfrout_client) :
     config_session_(NULL), verbose_mode_(false),
     xfrin_session_(NULL),
-    is_axfr_connection_established_(false),
+    xfrout_connected_(false),
     xfrout_client_(xfrout_client)
 {
     // cur_datasrc_ is automatically initialized by the default constructor,
@@ -121,9 +121,9 @@ AuthSrvImpl::AuthSrvImpl(const bool use_cache,
 }
 
 AuthSrvImpl::~AuthSrvImpl() {
-    if (is_axfr_connection_established_) {
+    if (xfrout_connected_) {
         xfrout_client_.disconnect();
-        is_axfr_connection_established_ = false;
+        xfrout_connected_ = false;
     }
 }
 
@@ -347,22 +347,22 @@ AuthSrvImpl::processAxfrQuery(const IOMessage& io_message, Message& message,
     }
 
     try {
-        if (!is_axfr_connection_established_) {
+        if (!xfrout_connected_) {
             xfrout_client_.connect();
-            is_axfr_connection_established_ = true;
+            xfrout_connected_ = true;
         }
         xfrout_client_.sendXfroutRequestInfo(
             io_message.getSocket().getNative(),
             io_message.getData(),
             io_message.getDataSize());
     } catch (const XfroutError& err) {
-        if (is_axfr_connection_established_) {
+        if (xfrout_connected_) {
             // discoonect() may trigger an exception, but since we try it
             // only if we've successfully opened it, it shouldn't happen in
             // normal condition.  Should this occur, we'll propagate it to the
             // upper layer.
             xfrout_client_.disconnect();
-            is_axfr_connection_established_ = false;
+            xfrout_connected_ = false;
         }
         
         if (verbose_mode_) {

+ 7 - 0
src/bin/auth/auth_srv.h

@@ -51,6 +51,13 @@ private:
     AuthSrv(const AuthSrv& source);
     AuthSrv& operator=(const AuthSrv& source);
 public:
+    /// The constructor.
+    ///
+    /// \param use_cache Whether to enable hot spot cache for lookup results.
+    /// \param xfrout_client Communication interface with a separate xfrout
+    /// process.  It's normally a reference to an xfr::XfroutClient object,
+    /// but can refer to a local mock object for testing (or other
+    /// experimental) purposes.
     AuthSrv(const bool use_cache,
             isc::xfr::AbstractXfroutClient& xfrout_client);
     ~AuthSrv();