Commit 3a03b359 authored by Jeremy C. Reed's avatar Jeremy C. Reed
Browse files

merge trunk back into this.

Also commit one extra line to configure.ac
+AC_SUBST(PYCOVERAGE_RUN)
(not sure how that disappeared but my last changes would have never worked)



git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac362@3625 e5f2f494-b856-4b98-b285-d166d9295462
parents 0963188c ca730c45
120. [func] jinmei
src/lib/dns: introduced two new classes, TSIGKey and TSIGKeyRing,
to manage TSIG keys. (Trac #381, svn r3622)
119. [bug] jinmei
The master file parser of the python datasrc module incorrectly
regarded a domain name beginning with a decimal number as a TTL
specification. This confused b10-loadzone and had it reject to
load a zone file that contains such a name.
Note: this fix is incomplete and the loadzone would still be
confused if the owner name is a syntactically indistinguishable
from a TTL specification. This is part of a more general issue
and will be addressed in Trac #413. (Trac #411, svn r3599)
118. [func] jinmei
src/lib/dns: changed the interface of AbstractRRset::getRdataIterator()
so that the internal cursor would point to the first RDATA
automatically. This will be a more intuitive and less error prone
behavior. This is a backward compatible change. (Trac #410, r3595)
117. [func] jinmei
src/lib/datasrc: added new zone and zone table classes for the
support of in memory data source. This is an intermediate step to
the bigger feature, and is not yet actually usable in practice.
(Trac #399, svn r3590)
116. [bug] jerry
src/bin/xfrout: Xfrout and Auth will communicate by long tcp
connection, Auth needs to make a new connection only on the first
time or if an error occurred.
(Trac #299, svn r3482)
115. [func]* jinmei
src/lib/dns: Changed DNS message flags and section names from
separate classes to simpler enums, considering the balance between
type safety and usability. API has been changed accordingly.
More documentation and tests were provided with these changes.
(Trac #358, r3439)
114. [build] jinmei
Supported clang++. Note: Boost >= 1.44 is required.
(Trac #365, svn r3383)
113. [func]* zhanglikun
Folder name 'utils'(the folder in /src/lib/python/isc/) has been
renamed to 'util'. Programs that used 'import isc.utils.process'
now need to use 'import isc.util.process'. The folder
/src/lib/python/isc/Util is removed since it isn't used by any
program. (Trac #364, r3382)
112. [func] zhang likun
Add one mixin class to override the naive serve_forever() provided
in python library socketserver. Instead of polling for shutdwon
every poll_interval seconds, one socketpair is used to wake up
the waiting server.(Trac #352, svn r3366)
111. [bug]* zhanglikun, Michal Vaner
Make sure process xfrin/xfrout/zonemgr/cmdctl can be stoped
properly when user enter "ctrl+c" or 'Boss shutdown' command
through bindctl.
The ZonemgrRefresh.run_timer and NotifyOut.dispatcher spawn
a thread themselves.
(Trac #335, svn r3273)
110. [func] Michal Vaner
Added isc.net.check module to check ip addresses and ports for
correctness and isc.net.addr to hold IP address. The bind10, xfrin
and cmdctl programs are modified to use it.
(Trac #353, svn r3240)
109. [func] naokikambe
Added the initial version of the stats module for the statistics
feature of BIND 10, which supports the restricted features and
items and reports via bindctl command (Trac #191, r3218)
Added the document of the stats module, which is about how stats
module collects the data (Trac #170, [wiki:StatsModule])
108. [func] jerry
src/bin/zonemgr: Provide customizable configurations for
lowerbound_refresh, lowerbound_retry, max_transfer_timeout and
jitter_scope. (Trac #340, r3205)
107. [func] zhang likun
Remove the parameter 'db_file' for command 'retransfer' of
xfrin module. xfrin.spec will not be generated by script.
(Trac #329, r3171)
106. [bug] zhang likun
When xfrin can't connect with one zone's master, it should tell
the bad news to zonemgr, so that zonemgr can reset the timer for
that zone. (Trac #329, r3170)
105. [bug] Michal Vaner
Python processes: they no longer take 100% CPU while idle
due to a busy loop in reading command session in a nonblocking way.
(Trac #349, svn r3153), (Trac #382, svn r3294)
104. [bug] jerry
bin/zonemgr: zonemgr should be attempting to refresh expired zones.
(Trac #336, r3139)
103. [bug] jerry
lib/python/isc/log: Fixed an issue with python logging,
python log shouldn't die with OSError.(Trac #267, r3137)
102. [build] jinmei
Disable threads in ASIO to minimize build time dependency.
(Trac #345, r3100)
......@@ -89,8 +195,8 @@ bind10-devel-20100917 released on September 17, 2010
zone axfr/ixfr finishing, the server will notify its slaves.
(Trac #289, svn r2737)
86. [func] jerry
bin/zonemgr: Added zone manager module. The zone manager is one
86. [func] jerry
bin/zonemgr: Added zone manager module. The zone manager is one
of the co-operating processes of BIND10, which keeps track of
timers and other information necessary for BIND10 to act as a
slave. (Trac #215, svn r2737)
......
......@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.59])
AC_INIT(bind10-devel, 20100701, bind10-dev@isc.org)
AC_INIT(bind10-devel, 20101013, bind10-dev@isc.org)
AC_CONFIG_SRCDIR(README)
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS([config.h])
......@@ -17,6 +17,8 @@ AC_LANG([C++])
# Identify the compiler: this check must be after AC_PROG_CXX and AC_LANG.
AM_CONDITIONAL(USE_GXX, test "X${GXX}" = "Xyes")
AC_CHECK_DECL([__SUNPRO_CC], [SUNCXX="yes"], [SUNCXX="no"])
AC_CHECK_DECL([__clang__], [CLANGPP="yes"], [CLANGPP="no"])
AM_CONDITIONAL(USE_CLANGPP, test "X${CLANGPP}" = "Xyes")
# Linker options
......@@ -204,7 +206,6 @@ fi
# gcc specific settings:
if test "X$GXX" = "Xyes"; then
B10_CXXFLAGS="-Wall -Wextra -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare"
UNUSED_PARAM_ATTRIBUTE='__attribute__((unused))'
# Certain versions of gcc (g++) have a bug that incorrectly warns about
# the use of anonymous name spaces even if they're closed in a single
......@@ -223,7 +224,6 @@ CXXFLAGS="$CXXFLAGS_SAVED"
fi dnl GXX = yes
AM_CONDITIONAL(GCC_WERROR_OK, test $werror_ok = 1)
AC_DEFINE_UNQUOTED(UNUSED_PARAM, $UNUSED_PARAM_ATTRIBUTE, Define to compiler keyword indicating a function argument is intentionally unused)
# produce PIC unless we disable shared libraries. need this for python bindings.
if test $enable_shared != "no" -a "X$GXX" = "Xyes"; then
......@@ -271,6 +271,7 @@ else
fi
AM_CONDITIONAL(ENABLE_PYTHON_COVERAGE, test x$USE_PYCOVERAGE != xno)
AC_SUBST(PYCOVERAGE)
AC_SUBST(PYCOVERAGE_RUN)
AC_SUBST(USE_PYCOVERAGE)
AC_ARG_WITH(lcov,
......@@ -280,7 +281,6 @@ AC_ARG_WITH(gtest,
[ --with-gtest=PATH specify a path to gtest header files (PATH/include) and library (PATH/lib)],
gtest_path="$withval", gtest_path="no")
USE_LCOV="no"
if test "$lcov" != "no"; then
# force gtest if not set
......@@ -333,12 +333,14 @@ if test -z "$with_boost_include"; then
fi
done
fi
CPPFLAGS_SAVES="$CPPFLAGS"
if test "${boost_include_path}" ; then
BOOST_INCLUDES="-I${boost_include_path}"
CPPFLAGS="$CPPFLAGS $BOOST_INCLUDES"
fi
AC_CHECK_HEADERS([boost/shared_ptr.hpp boost/foreach.hpp],,
AC_MSG_ERROR([Missing required header files.]))
CPPFLAGS="$CPPFLAGS_SAVES"
AC_SUBST(BOOST_INCLUDES)
#
......@@ -454,7 +456,7 @@ if test "X$ac_cv_have_devpoll" = "Xyes" -a "X$GXX" = "Xyes"; then
fi
AC_ARG_ENABLE(man, [AC_HELP_STRING([--enable-man],
[regenerate man pages [default=no]])] ,enable_man=yes, enable_man=no)
[regenerate man pages [default=no]])], enable_man=yes, enable_man=no)
AM_CONDITIONAL(ENABLE_MAN, test x$enable_man != xno)
......@@ -491,6 +493,13 @@ AC_CONFIG_FILES([Makefile
src/bin/xfrout/tests/Makefile
src/bin/zonemgr/Makefile
src/bin/zonemgr/tests/Makefile
src/bin/stats/Makefile
src/bin/stats/tests/Makefile
src/bin/stats/tests/isc/Makefile
src/bin/stats/tests/isc/cc/Makefile
src/bin/stats/tests/isc/config/Makefile
src/bin/stats/tests/isc/util/Makefile
src/bin/stats/tests/testdata/Makefile
src/bin/usermgr/Makefile
src/bin/tests/Makefile
src/lib/Makefile
......@@ -501,15 +510,18 @@ AC_CONFIG_FILES([Makefile
src/lib/cc/tests/Makefile
src/lib/python/Makefile
src/lib/python/isc/Makefile
src/lib/python/isc/utils/Makefile
src/lib/python/isc/utils/tests/Makefile
src/lib/python/isc/util/Makefile
src/lib/python/isc/util/tests/Makefile
src/lib/python/isc/datasrc/Makefile
src/lib/python/isc/datasrc/tests/Makefile
src/lib/python/isc/cc/Makefile
src/lib/python/isc/cc/tests/Makefile
src/lib/python/isc/config/Makefile
src/lib/python/isc/config/tests/Makefile
src/lib/python/isc/log/Makefile
src/lib/python/isc/log/tests/Makefile
src/lib/python/isc/net/Makefile
src/lib/python/isc/net/tests/Makefile
src/lib/python/isc/notify/Makefile
src/lib/python/isc/notify/tests/Makefile
src/lib/config/Makefile
......@@ -534,7 +546,6 @@ AC_OUTPUT([src/bin/cfgmgr/b10-cfgmgr.py
src/bin/cmdctl/cmdctl.spec.pre
src/bin/xfrin/tests/xfrin_test
src/bin/xfrin/xfrin.py
src/bin/xfrin/xfrin.spec.pre
src/bin/xfrin/run_b10-xfrin.sh
src/bin/xfrout/xfrout.py
src/bin/xfrout/xfrout.spec.pre
......@@ -544,6 +555,12 @@ AC_OUTPUT([src/bin/cfgmgr/b10-cfgmgr.py
src/bin/zonemgr/zonemgr.spec.pre
src/bin/zonemgr/tests/zonemgr_test
src/bin/zonemgr/run_b10-zonemgr.sh
src/bin/stats/stats.py
src/bin/stats/stats_stub.py
src/bin/stats/stats.spec.pre
src/bin/stats/run_b10-stats.sh
src/bin/stats/run_b10-stats_stub.sh
src/bin/stats/tests/stats_test
src/bin/bind10/bind10.py
src/bin/bind10/tests/bind10_test
src/bin/bind10/run_bind10.sh
......@@ -577,6 +594,9 @@ AC_OUTPUT([src/bin/cfgmgr/b10-cfgmgr.py
chmod +x src/bin/xfrin/run_b10-xfrin.sh
chmod +x src/bin/xfrout/run_b10-xfrout.sh
chmod +x src/bin/zonemgr/run_b10-zonemgr.sh
chmod +x src/bin/stats/tests/stats_test
chmod +x src/bin/stats/run_b10-stats.sh
chmod +x src/bin/stats/run_b10-stats_stub.sh
chmod +x src/bin/bind10/run_bind10.sh
chmod +x src/bin/cmdctl/tests/cmdctl_test
chmod +x src/bin/xfrin/tests/xfrin_test
......@@ -607,6 +627,8 @@ Package:
Name: $PACKAGE_NAME
Version: $PACKAGE_VERSION
C++ Compiler: $CXX
Flags:
DEFS: $DEFS
CPPFLAGS: $CPPFLAGS
......@@ -616,6 +638,7 @@ dnl includes too
Python: ${PYTHON_INCLUDES}
${PYTHON_LDFLAGS}
${PYTHON_LIB}
Boost: ${BOOST_INCLUDES}
SQLite: $SQLITE_CFLAGS
$SQLITE_LIBS
......@@ -636,4 +659,3 @@ cat <<EOF
Now you can type "make" to build BIND 10
EOF
SUBDIRS = bind10 bindctl cfgmgr loadzone msgq host cmdctl auth xfrin xfrout \
usermgr zonemgr tests
usermgr zonemgr stats tests
check-recursive: all-recursive
......@@ -5,6 +5,7 @@ AM_CPPFLAGS += -I$(top_srcdir)/src/bin -I$(top_builddir)/src/bin
AM_CPPFLAGS += -I$(top_srcdir)/src/lib/dns -I$(top_builddir)/src/lib/dns
AM_CPPFLAGS += -I$(top_builddir)/src/lib/cc
AM_CPPFLAGS += -I$(top_srcdir)/src/bin -I$(top_builddir)/src/bin
AM_CPPFLAGS += $(BOOST_INCLUDES)
AM_CXXFLAGS = $(B10_CXXFLAGS)
......@@ -46,6 +47,10 @@ libasio_link_a_CXXFLAGS = $(AM_CXXFLAGS)
if USE_GXX
libasio_link_a_CXXFLAGS += -Wno-unused-parameter
endif
if USE_CLANGPP
# Same for clang++, but we need to turn off -Werror completely.
libasio_link_a_CXXFLAGS += -Wno-error
endif
libasio_link_a_CPPFLAGS = $(AM_CPPFLAGS)
BUILT_SOURCES = spec_config.h
......
......@@ -64,24 +64,50 @@ IOAddress::toText() const {
return (asio_address_.to_string());
}
// Note: this implementation is optimized for the case where this object
// is created from an ASIO endpoint object in a receiving code path
// by avoiding to make a copy of the base endpoint. For TCP it may not be
// a big deal, but when we receive UDP packets at a high rate, the copy
// overhead might be significant.
/// \brief The \c TCPEndpoint class is a concrete derived class of
/// \c IOEndpoint that represents an endpoint of a TCP connection.
///
/// In the current implementation, an object of this class is always
/// instantiated within the wrapper routines. Applications are expected to
/// get access to the object via the abstract base class, \c IOEndpoint.
/// This design may be changed when we generalize the wrapper interface.
///
/// Note: this implementation is optimized for the case where this object
/// is created from an ASIO endpoint object in a receiving code path
/// by avoiding to make a copy of the base endpoint. For TCP it may not be
/// a big deal, but when we receive UDP packets at a high rate, the copy
/// overhead might be significant.
class TCPEndpoint : public IOEndpoint {
public:
///
/// \name Constructors and Destructor
///
//@{
/// \brief Constructor from a pair of address and port.
///
/// \param address The IP address of the endpoint.
/// \param port The TCP port number of the endpoint.
TCPEndpoint(const IOAddress& address, const unsigned short port) :
asio_endpoint_placeholder_(
new tcp::endpoint(ip::address::from_string(address.toText()),
port)),
asio_endpoint_(*asio_endpoint_placeholder_)
{}
/// \brief Constructor from an ASIO TCP endpoint.
///
/// This constructor is designed to be an efficient wrapper for the
/// corresponding ASIO class, \c tcp::endpoint.
///
/// \param asio_endpoint The ASIO representation of the TCP endpoint.
TCPEndpoint(const tcp::endpoint& asio_endpoint) :
asio_endpoint_placeholder_(NULL), asio_endpoint_(asio_endpoint)
{}
/// \brief The destructor.
~TCPEndpoint() { delete asio_endpoint_placeholder_; }
//@}
virtual IOAddress getAddress() const {
return (asio_endpoint_.address());
}
......@@ -90,18 +116,41 @@ private:
const tcp::endpoint& asio_endpoint_;
};
/// \brief The \c UDPEndpoint class is a concrete derived class of
/// \c IOEndpoint that represents an endpoint of a UDP packet.
///
/// Other notes about \c TCPEndpoint applies to this class, too.
class UDPEndpoint : public IOEndpoint {
public:
///
/// \name Constructors and Destructor.
///
//@{
/// \brief Constructor from a pair of address and port.
///
/// \param address The IP address of the endpoint.
/// \param port The UDP port number of the endpoint.
UDPEndpoint(const IOAddress& address, const unsigned short port) :
asio_endpoint_placeholder_(
new udp::endpoint(ip::address::from_string(address.toText()),
port)),
asio_endpoint_(*asio_endpoint_placeholder_)
{}
/// \brief Constructor from an ASIO UDP endpoint.
///
/// This constructor is designed to be an efficient wrapper for the
/// corresponding ASIO class, \c udp::endpoint.
///
/// \param asio_endpoint The ASIO representation of the UDP endpoint.
UDPEndpoint(const udp::endpoint& asio_endpoint) :
asio_endpoint_placeholder_(NULL), asio_endpoint_(asio_endpoint)
{}
/// \brief The destructor.
~UDPEndpoint() { delete asio_endpoint_placeholder_; }
//@}
virtual IOAddress getAddress() const {
return (asio_endpoint_.address());
}
......@@ -124,37 +173,74 @@ IOEndpoint::create(const int protocol, const IOAddress& address,
protocol);
}
/// \brief The \c TCPSocket class is a concrete derived class of
/// \c IOSocket that represents a TCP socket.
///
/// In the current implementation, an object of this class is always
/// instantiated within the wrapper routines. Applications are expected to
/// get access to the object via the abstract base class, \c IOSocket.
/// This design may be changed when we generalize the wrapper interface.
class TCPSocket : public IOSocket {
private:
TCPSocket(const TCPSocket& source);
TCPSocket& operator=(const TCPSocket& source);
public:
/// \brief Constructor from an ASIO TCP socket.
///
/// \param socket The ASIO representation of the TCP socket.
TCPSocket(tcp::socket& socket) : socket_(socket) {}
virtual int getNative() const { return (socket_.native()); }
virtual int getProtocol() const { return (IPPROTO_TCP); }
private:
tcp::socket& socket_;
};
/// \brief The \c UDPSocket class is a concrete derived class of
/// \c IOSocket that represents a UDP socket.
///
/// Other notes about \c TCPSocket applies to this class, too.
class UDPSocket : public IOSocket {
private:
UDPSocket(const UDPSocket& source);
UDPSocket& operator=(const UDPSocket& source);
public:
/// \brief Constructor from an ASIO UDP socket.
///
/// \param socket The ASIO representation of the UDP socket.
UDPSocket(udp::socket& socket) : socket_(socket) {}
virtual int getNative() const { return (socket_.native()); }
virtual int getProtocol() const { return (IPPROTO_UDP); }
private:
udp::socket& socket_;
};
/// \brief The \c DummySocket class is a concrete derived class of
/// \c IOSocket that is not associated with any real socket.
///
/// This main purpose of this class is tests, where it may be desirable to
/// instantiate an \c IOSocket object without involving system resource
/// allocation such as real network sockets.
class DummySocket : public IOSocket {
private:
DummySocket(const DummySocket& source);
DummySocket& operator=(const DummySocket& source);
public:
/// \brief Constructor from the protocol number.
///
/// The protocol must validly identify a standard network protocol.
/// For example, to specify TCP \c protocol must be \c IPPROTO_TCP.
///
/// \param protocol The network protocol number for the socket.
DummySocket(const int protocol) : protocol_(protocol) {}
/// \brief A dummy derived method of \c IOSocket::getNative().
///
/// This version of method always returns -1 as the object is not
/// associated with a real (native) socket.
virtual int getNative() const { return (-1); }
virtual int getProtocol() const { return (protocol_); }
private:
const int protocol_;
......@@ -197,8 +283,8 @@ public:
void start() {
// Check for queued configuration commands
if (auth_server_ != NULL &&
auth_server_->configSession()->hasQueuedMsgs()) {
auth_server_->configSession()->checkCommand();
auth_server_->getConfigSession()->hasQueuedMsgs()) {
auth_server_->getConfigSession()->checkCommand();
}
async_read(socket_, asio::buffer(data_, TCP_MESSAGE_LENGTHSIZE),
boost::bind(&TCPClient::headerRead, this,
......@@ -385,8 +471,8 @@ public:
{
// Check for queued configuration commands
if (auth_server_ != NULL &&
auth_server_->configSession()->hasQueuedMsgs()) {
auth_server_->configSession()->checkCommand();
auth_server_->getConfigSession()->hasQueuedMsgs()) {
auth_server_->getConfigSession()->checkCommand();
}
if (!error && bytes_recvd > 0) {
const UDPEndpoint remote_endpoint(sender_endpoint_);
......@@ -419,9 +505,7 @@ public:
}
}
void sendCompleted(const asio::error_code& error UNUSED_PARAM,
size_t bytes_sent UNUSED_PARAM)
{
void sendCompleted(const asio::error_code&, size_t) {
// Even if error occurred there's nothing to do. Simply handle
// the next request.
startReceive();
......
......@@ -88,7 +88,7 @@ class AuthSrv;
/// http://think-async.com/Asio/asio-1.3.1/doc/asio/reference/asio_handler_allocate.html
namespace asio_link {
struct IOServiceImpl;
class IOServiceImpl;
/// \brief An exception that is thrown if an error occurs within the IO
/// module. This is mainly intended to be a wrapper exception class for
......@@ -132,7 +132,7 @@ public:
/// This constructor never throws an exception.
///
/// \param asio_address The ASIO \c ip::address to be converted.
IOAddress(const asio::ip::address& asio_adress);
IOAddress(const asio::ip::address& asio_address);
//@}
/// \brief Convert the address to a string.
......
......@@ -77,7 +77,7 @@ public:
MessageRenderer& response_renderer);
bool processAxfrQuery(const IOMessage& io_message, Message& message,
MessageRenderer& response_renderer);
bool processNotify(const IOMessage& io_message, Message& message,
bool processNotify(const IOMessage& io_message, Message& message,
MessageRenderer& response_renderer);
std::string db_file_;
ModuleCCSession* config_session_;
......@@ -152,8 +152,8 @@ makeErrorMessage(Message& message, MessageRenderer& renderer,
// XXX: with the current implementation, it's not easy to set EDNS0
// depending on whether the query had it. So we'll simply omit it.
const qid_t qid = message.getQid();
const bool rd = message.getHeaderFlag(MessageFlag::RD());
const bool cd = message.getHeaderFlag(MessageFlag::CD());
const bool rd = message.getHeaderFlag(Message::HEADERFLAG_RD);
const bool cd = message.getHeaderFlag(Message::HEADERFLAG_CD);
const Opcode& opcode = message.getOpcode();
vector<QuestionPtr> questions;
......@@ -166,12 +166,12 @@ makeErrorMessage(Message& message, MessageRenderer& renderer,
message.clear(Message::RENDER);
message.setQid(qid);
message.setOpcode(opcode);
message.setHeaderFlag(MessageFlag::QR());
message.setHeaderFlag(Message::HEADERFLAG_QR);
if (rd) {
message.setHeaderFlag(MessageFlag::RD());
message.setHeaderFlag(Message::HEADERFLAG_RD);
}
if (cd) {
message.setHeaderFlag(MessageFlag::CD());
message.setHeaderFlag(Message::HEADERFLAG_CD);
}
for_each(questions.begin(), questions.end(), QuestionInserter(&message));
message.setRcode(rcode);
......@@ -215,7 +215,7 @@ AuthSrv::setConfigSession(ModuleCCSession* config_session) {
}
ModuleCCSession*
AuthSrv::configSession() const {
AuthSrv::getConfigSession() const {
return (impl_->config_session_);
}
......@@ -231,7 +231,7 @@ AuthSrv::processMessage(const IOMessage& io_message, Message& message,
message.parseHeader(request_buffer);
// Ignore all responses.
if (message.getHeaderFlag(MessageFlag::QR())) {
if (message.getHeaderFlag(Message::HEADERFLAG_QR)) {
if (impl_->verbose_mode_) {
cerr << "[b10-auth] received unexpected response, ignoring"
<< endl;
......@@ -279,7 +279,7 @@ AuthSrv::processMessage(const IOMessage& io_message, Message& message,
return (true);
}
if (message.getRRCount(Section::QUESTION()) != 1) {
if (message.getRRCount(Message::SECTION_QUESTION) != 1) {
makeErrorMessage(message, response_renderer, Rcode::FORMERR(),
impl_->verbose_mode_);
return (true);
......@@ -307,10 +307,10 @@ AuthSrvImpl::processNormalQuery(const IOMessage& io_message, Message& message,
ConstEDNSPtr remote_edns = message.getEDNS();
const bool dnssec_ok = remote_edns && remote_edns->getDNSSECAwareness();
const uint16_t remote_bufsize = remote_edns ? remote_edns->getUDPSize() :
Message::DEFAULT_MAX_UDPSIZE;
Message::DEFAULT_MAX_UDPSIZE;
message.makeResponse();
message.setHeaderFlag(MessageFlag::AA());
message.setHeaderFlag(Message::HEADERFLAG_AA);
message.setRcode(Rcode::NOERROR());
if (remote_edns) {
......@@ -360,8 +360,10 @@ AuthSrvImpl::processAxfrQuery(const IOMessage& io_message, Message& message,
}
try {
xfrout_client_.connect();
xfrout_connected_ = true;
if (!xfrout_connected_) {
xfrout_client_.connect();
xfrout_connected_ = true;
}
xfrout_client_.sendXfroutRequestInfo(
io_message.getSocket().getNative(),
io_message.getData(),
......@@ -375,7 +377,7 @@ AuthSrvImpl::processAxfrQuery(const IOMessage& io_message, Message& message,
xfrout_client_.disconnect();
xfrout_connected_ = false;
}
if (verbose_mode_) {
cerr << "[b10-auth] Error in handling XFR request: " << err.what()
<< endl;
......@@ -385,22 +387,19 @@ AuthSrvImpl::processAxfrQuery(const IOMessage& io_message, Message& message,
return (true);
}
xfrout_client_.disconnect();
xfrout_connected_ = false;
return (false);
}
bool
AuthSrvImpl::processNotify(const IOMessage& io_message, Message& message,
MessageRenderer& response_renderer)
AuthSrvImpl::processNotify(const IOMessage& io_message, Message& message,
MessageRenderer& response_renderer)
{
// The incoming notify must contain exactly one question for SOA of the
// zone name.
if (message.getRRCount(Section::QUESTION()) != 1) {
if (message.getRRCount(Message::SECTION_QUESTION) != 1) {
if (verbose_mode_) {
cerr << "[b10-auth] invalid number of questions in notify: "
<< message.getRRCount(Section::QUESTION()) << endl;
<< message.getRRCount(Message::SECTION_QUESTION) << endl;
}