BIND 10 trac1986, updated. 96f4382db5fdd9df1a63d658e9baae1b48502537 [1986] Cleanups; use scoped_ptr, and more log msgs
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Jul 9 19:35:44 UTC 2012
The branch, trac1986 has been updated
via 96f4382db5fdd9df1a63d658e9baae1b48502537 (commit)
from 64d089fdc9afb69b581892764e8cccd47d958013 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 96f4382db5fdd9df1a63d658e9baae1b48502537
Author: Jelte Jansen <jelte at isc.org>
Date: Mon Jul 9 21:35:00 2012 +0200
[1986] Cleanups; use scoped_ptr, and more log msgs
- use scoped_ptr instead of raw pointer and 'manual' cleanup
- log errors in b10-ddns if there is an error response from b10-auth
- minor other cleanups
-----------------------------------------------------------------------
Summary of changes:
src/bin/auth/auth.spec.pre.in | 4 ++--
src/bin/auth/auth_messages.mes | 6 +++---
src/bin/auth/auth_srv.cc | 21 +++++++--------------
src/bin/ddns/ddns.py.in | 4 ++--
src/bin/ddns/ddns_messages.mes | 12 ++++++++++++
5 files changed, 26 insertions(+), 21 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/auth/auth.spec.pre.in b/src/bin/auth/auth.spec.pre.in
index 2e74e8c..0ed00ac 100644
--- a/src/bin/auth/auth.spec.pre.in
+++ b/src/bin/auth/auth.spec.pre.in
@@ -134,12 +134,12 @@
},
{
"command_name": "start_ddns_forwarder",
- "command_description": "(Re)start internal forwarding of DDNS Update packets.",
+ "command_description": "(Re)start internal forwarding of DDNS Update packets. This is automatically called if b10-ddns is started.",
"command_args": []
},
{
"command_name": "stop_ddns_forwarder",
- "command_description": "Stop internal forwarding of DDNS Update packets",
+ "command_description": "Stop internal forwarding of DDNS Update packets. This is automatically called if b10-ddns is stopped.",
"command_args": []
}
],
diff --git a/src/bin/auth/auth_messages.mes b/src/bin/auth/auth_messages.mes
index 7e15f57..e964b05 100644
--- a/src/bin/auth/auth_messages.mes
+++ b/src/bin/auth/auth_messages.mes
@@ -110,9 +110,6 @@ look into the cause and address the issue. The log message includes
the client's address (and port), and the error message sent from the
lower layer that detects the failure.
-% AUTH_RECEIVED_NOTIFY received incoming NOTIFY for zone name %1, zone class %2
-This is a debug message reporting that an incoming NOTIFY was received.
-
% AUTH_NOTIFY_QUESTIONS invalid number of questions (%1) in incoming NOTIFY
This debug message is logged by the authoritative server when it receives
a NOTIFY packet that contains zero or more than one question. (A valid
@@ -169,6 +166,9 @@ bug ticket for this issue.
This is a debug message issued when the authoritative server has received
a command on the command channel.
+% AUTH_RECEIVED_NOTIFY received incoming NOTIFY for zone name %1, zone class %2
+This is a debug message reporting that an incoming NOTIFY was received.
+
% AUTH_RECEIVED_SENDSTATS command 'sendstats' received
This is a debug message issued when the authoritative server has received
a command from the statistics module to send it data. The 'sendstats'
diff --git a/src/bin/auth/auth_srv.cc b/src/bin/auth/auth_srv.cc
index f51bf59..8b2ef9c 100644
--- a/src/bin/auth/auth_srv.cc
+++ b/src/bin/auth/auth_srv.cc
@@ -58,6 +58,7 @@
#include <boost/bind.hpp>
#include <boost/lexical_cast.hpp>
+#include <boost/scoped_ptr.hpp>
#include <algorithm>
#include <cassert>
@@ -303,7 +304,7 @@ private:
// Socket session forwarder for dynamic update requests
BaseSocketSessionForwarder& ddns_base_forwarder_;
- SocketSessionForwarderHolder* ddns_forwarder_;
+ boost::scoped_ptr<SocketSessionForwarderHolder> ddns_forwarder_;
/// Increment query counter
void incCounter(const int protocol);
@@ -337,9 +338,6 @@ AuthSrvImpl::AuthSrvImpl(const bool use_cache,
// enable or disable the cache
cache_.setEnabled(use_cache);
-
- // TODO: REMOVE and create 'on demand'
- //createDDNSForwarder();
}
AuthSrvImpl::~AuthSrvImpl() {
@@ -347,7 +345,6 @@ AuthSrvImpl::~AuthSrvImpl() {
xfrout_client_.disconnect();
xfrout_connected_ = false;
}
- destroyDDNSForwarder();
}
// This is a derived class of \c DNSLookup, to serve as a
@@ -892,25 +889,21 @@ AuthSrvImpl::processNotify(const IOMessage& io_message, Message& message,
bool
AuthSrvImpl::hasDDNSForwarder() {
- return (ddns_forwarder_ != NULL);
+ return (ddns_forwarder_);
}
void
AuthSrvImpl::createDDNSForwarder() {
- if (hasDDNSForwarder()) {
- destroyDDNSForwarder();
- }
LOG_DEBUG(auth_logger, DBG_AUTH_OPS, AUTH_START_DDNS_FORWARDER);
- ddns_forwarder_ = new SocketSessionForwarderHolder("update",
- ddns_base_forwarder_);
+ ddns_forwarder_.reset(
+ new SocketSessionForwarderHolder("update", ddns_base_forwarder_));
}
void
AuthSrvImpl::destroyDDNSForwarder() {
- if (ddns_forwarder_ != NULL) {
+ if (ddns_forwarder_) {
LOG_DEBUG(auth_logger, DBG_AUTH_OPS, AUTH_STOP_DDNS_FORWARDER);
- delete ddns_forwarder_;
- ddns_forwarder_ = NULL;
+ ddns_forwarder_.reset();
}
}
diff --git a/src/bin/ddns/ddns.py.in b/src/bin/ddns/ddns.py.in
index 98685f6..00d5795 100755
--- a/src/bin/ddns/ddns.py.in
+++ b/src/bin/ddns/ddns.py.in
@@ -548,7 +548,7 @@ class DDNSServer:
answer, _ = self._cc._session.group_recvmsg(False, seq)
rcode, error_msg = parse_answer(answer)
if (rcode != 0):
- raise Exception(error_msg)
+ logger.error(DDNS_START_FORWARDER_ERROR, error_msg)
def __notify_stop_forwarder(self):
'''Notify auth that DDNS Update packets can now be forwarded'''
@@ -557,7 +557,7 @@ class DDNSServer:
answer, _ = self._cc._session.group_recvmsg(False, seq)
rcode, error_msg = parse_answer(answer)
if (rcode != 0):
- raise Exception(error_msg)
+ logger.error(DDNS_STOP_FORWARDER_ERROR, error_msg)
def __notify_auth(self, zname, zclass):
'''Notify auth of the update, if necessary.'''
diff --git a/src/bin/ddns/ddns_messages.mes b/src/bin/ddns/ddns_messages.mes
index 92099fd..cf896e5 100644
--- a/src/bin/ddns/ddns_messages.mes
+++ b/src/bin/ddns/ddns_messages.mes
@@ -192,6 +192,12 @@ be completed, after which the process will exit.
The ddns process has successfully started and is now ready to receive commands
and updates.
+% DDNS_START_FOWARDER_ERROR Error from b10-auth when requesting DDNS UPDATE forwarding: %1
+There was an error response from b10-auth to the command to start
+forwarding DDNS UPDATE messages to b10-ddns.
+The error message is printed, and additional information may be found in
+the b10-auth log output.
+
% DDNS_STOPPED ddns server has stopped
The ddns process has successfully stopped and is no longer listening for or
handling commands or updates, and will now exit.
@@ -200,6 +206,12 @@ handling commands or updates, and will now exit.
There was a keyboard interrupt signal to stop the ddns process. The
process will now shut down.
+% DDNS_STOP_FOWARDER_ERROR Error from b10-auth when requesting to stop DDNS UPDATE forwarding: %1
+There was an error response from b10-auth to the command to stop
+forwarding DDNS UPDATE messages to b10-ddns.
+The error message is printed, and additional information may be found in
+the b10-auth log output.
+
% DDNS_UNCAUGHT_EXCEPTION uncaught exception of type %1: %2
The b10-ddns process encountered an uncaught exception and will now shut
down. This is indicative of a programming error and should not happen under
More information about the bind10-changes
mailing list