From: Michal 'vorner' Vaner Date: Thu, 21 Jun 2012 12:52:24 +0000 (+0200) Subject: [1976] Do the real initialization of the datasrc configurator X-Git-Tag: trac2351_base~97^2~7^2~2^2~21^2~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6107757547e99687e84c8c19f412801ac926a342;p=thirdparty%2Fkea.git [1976] Do the real initialization of the datasrc configurator The type of lists had to be changed to the Configurable ones, unfortunately. It doesn't work otherwise. Therefore, it may be possible to fold the ClientList hierarchy, but I'm postponing that work. --- diff --git a/src/bin/auth/auth_srv.cc b/src/bin/auth/auth_srv.cc index 5458316564..c4e69202d2 100644 --- a/src/bin/auth/auth_srv.cc +++ b/src/bin/auth/auth_srv.cc @@ -267,7 +267,7 @@ public: const boost::shared_ptr* keyring_; /// The client list - map > client_lists_; + map > client_lists_; /// Bind the ModuleSpec object in config_session_ with /// isc:config::ModuleSpec::validateStatistics. @@ -1030,7 +1030,7 @@ AuthSrv::setTSIGKeyRing(const boost::shared_ptr* keyring) { void AuthSrv::setClientList(const RRClass& rrclass, - const boost::shared_ptr& list) { + const boost::shared_ptr& list) { if (list) { impl_->client_lists_[rrclass] = list; } else { @@ -1038,12 +1038,12 @@ AuthSrv::setClientList(const RRClass& rrclass, } } -boost::shared_ptr +boost::shared_ptr AuthSrv::getClientList(const RRClass& rrclass) { - const map >::const_iterator - it(impl_->client_lists_.find(rrclass)); + const map >:: + const_iterator it(impl_->client_lists_.find(rrclass)); if (it == impl_->client_lists_.end()) { - return (boost::shared_ptr()); + return (boost::shared_ptr()); } else { return (it->second); } @@ -1052,9 +1052,9 @@ AuthSrv::getClientList(const RRClass& rrclass) { vector AuthSrv::getClientListClasses() const { vector result; - for (map >::const_iterator - it(impl_->client_lists_.begin()); it != impl_->client_lists_.end(); - ++ it) { + for (map >:: + const_iterator it(impl_->client_lists_.begin()); + it != impl_->client_lists_.end(); ++it) { result.push_back(it->first); } return (result); diff --git a/src/bin/auth/auth_srv.h b/src/bin/auth/auth_srv.h index ff0ed5b84c..ee8edc98e9 100644 --- a/src/bin/auth/auth_srv.h +++ b/src/bin/auth/auth_srv.h @@ -44,7 +44,7 @@ class BaseSocketSessionForwarder; } namespace datasrc { class InMemoryClient; -class ClientList; +class ConfigurableClientList; } namespace xfr { class AbstractXfroutClient; @@ -428,15 +428,15 @@ public: /// \param rrclass The class to modify. /// \param list Shared pointer to the client list. If it is NULL, /// the list is removed instead. - void setClientList(const isc::dns::RRClass& rrclass, - const boost::shared_ptr& + void setClientList(const isc::dns::RRClass& rrclass, const + boost::shared_ptr& list); /// \brief Returns the currently used client list for the class. /// /// \param rrclass The class for which to get the list. /// \return The list, or NULL if no list is set for the class. - boost::shared_ptr + boost::shared_ptr getClientList(const isc::dns::RRClass& rrclass); /// \brief Returns a list of classes that have a client list. diff --git a/src/bin/auth/main.cc b/src/bin/auth/main.cc index 67d0f3dcf6..f6b330e090 100644 --- a/src/bin/auth/main.cc +++ b/src/bin/auth/main.cc @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -204,6 +205,9 @@ main(int argc, char* argv[]) { isc::server_common::initKeyring(*config_session); auth_server->setTSIGKeyRing(&isc::server_common::keyring); + // Start the data source configuration + DataSourceConfigurator::init(config_session, auth_server); + // Now start asynchronous read. config_session->start(); LOG_DEBUG(auth_logger, DBG_AUTH_START, AUTH_CONFIG_CHANNEL_STARTED); @@ -211,7 +215,6 @@ main(int argc, char* argv[]) { // Successfully initialized. LOG_INFO(auth_logger, AUTH_SERVER_STARTED); io_service.run(); - } catch (const std::exception& ex) { LOG_FATAL(auth_logger, AUTH_SERVER_FAILED).arg(ex.what()); ret = 1; @@ -225,6 +228,7 @@ main(int argc, char* argv[]) { xfrin_session->disconnect(); } + DataSourceConfigurator::deinit(); delete statistics_session; delete xfrin_session; delete config_session;