summaryrefslogtreecommitdiffstats
path: root/src/bin/auth/main.cc
diff options
context:
space:
mode:
authorJINMEI Tatuya <jinmei@isc.org>2012-10-04 00:44:29 +0200
committerJINMEI Tatuya <jinmei@isc.org>2012-10-04 00:44:29 +0200
commit746376902a020e0711bc85fc29a2b339a85b3db2 (patch)
treef140608feaee38f757315b064288e64637e748e9 /src/bin/auth/main.cc
parent[2203] refactoring 2nd step: configurator can now be a separate object. (diff)
downloadkea-746376902a020e0711bc85fc29a2b339a85b3db2.tar.xz
kea-746376902a020e0711bc85fc29a2b339a85b3db2.zip
[2203] pass server obj to configurator's reconfigure().
now the configurator class is completely stateless.
Diffstat (limited to 'src/bin/auth/main.cc')
-rw-r--r--src/bin/auth/main.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/bin/auth/main.cc b/src/bin/auth/main.cc
index fa11521898..5a720637ef 100644
--- a/src/bin/auth/main.cc
+++ b/src/bin/auth/main.cc
@@ -73,7 +73,7 @@ namespace {
/* need global var for config/command handlers.
* todo: turn this around, and put handlers in the authserver
* class itself? */
-AuthSrv *auth_server;
+AuthSrv* auth_server;
ConstElementPtr
my_config_handler(ConstElementPtr new_config) {
@@ -87,12 +87,13 @@ my_command_handler(const string& command, ConstElementPtr args) {
}
void
-datasrcConfigHandler(DataSourceConfigurator* configurator, const std::string&,
- isc::data::ConstElementPtr config,
+datasrcConfigHandler(AuthSrv* server, DataSourceConfigurator* configurator,
+ const std::string&, isc::data::ConstElementPtr config,
const isc::config::ConfigData&)
{
+ assert(server != NULL);
if (config->contains("classes")) {
- configurator->reconfigure(config->get("classes"));
+ configurator->reconfigure(*server, config->get("classes"));
}
}
@@ -206,9 +207,10 @@ main(int argc, char* argv[]) {
auth_server->setTSIGKeyRing(&isc::server_common::keyring);
// Start the data source configuration
- datasrc_configurator.reset(new DataSourceConfigurator(auth_server));
+ datasrc_configurator.reset(new DataSourceConfigurator);
config_session->addRemoteConfig("data_sources",
boost::bind(datasrcConfigHandler,
+ auth_server,
datasrc_configurator.get(),
_1, _2, _3),
false);
@@ -217,6 +219,7 @@ main(int argc, char* argv[]) {
// get the default (or, current value). Further updates will work
// the usual way.
datasrc_configurator->reconfigure(
+ *auth_server,
config_session->getRemoteConfigValue("data_sources", "classes"));
// Now start asynchronous read.