Commit 5589ea8d authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[master] Merge branch 'trac1546'

parents 73d2c507 354bb735
......@@ -154,13 +154,15 @@ main(int argc, char* argv[]) {
cc_session = new Session(io_service.get_io_service());
LOG_DEBUG(auth_logger, DBG_AUTH_START, AUTH_CONFIG_CHANNEL_CREATED);
// Initialize the Socket Requestor
isc::server_common::initSocketReqeustor(*cc_session);
isc::server_common::initSocketRequestor(*cc_session);
// We delay starting listening to new commands/config just before we
// go into the main loop to avoid confusion due to mixture of
// synchronous and asynchronous operations (this would happen in
// initializing TSIG keys below). Until then all operations on the
// CC session will take place synchronously.
// initial communication with the boss that takes place in
// updateConfig() for listen_on and in initializing TSIG keys below).
// Until then all operations on the CC session will take place
// synchronously.
config_session = new ModuleCCSession(specfile, *cc_session,
my_config_handler,
my_command_handler, false);
......
......@@ -202,10 +202,13 @@ main(int argc, char* argv[]) {
LOG_DEBUG(resolver_logger, RESOLVER_DBG_INIT, RESOLVER_SERVICE_CREATED);
cc_session = new Session(io_service.get_io_service());
isc::server_common::initSocketReqeustor(*cc_session);
isc::server_common::initSocketRequestor(*cc_session);
// We delay starting listening to new commands/config just before we
// go into the main loop. See auth/main.cc for the rationale.
config_session = new ModuleCCSession(specfile, *cc_session,
my_config_handler,
my_command_handler);
my_command_handler, false);
LOG_DEBUG(resolver_logger, RESOLVER_DBG_INIT, RESOLVER_CONFIG_CHANNEL);
resolver->setConfigSession(config_session);
......@@ -218,6 +221,9 @@ main(int argc, char* argv[]) {
resolver->updateConfig(config_session->getFullConfig(), true);
LOG_DEBUG(resolver_logger, RESOLVER_DBG_INIT, RESOLVER_CONFIG_LOADED);
// Now start asynchronous read.
config_session->start();
LOG_INFO(resolver_logger, RESOLVER_STARTED);
io_service.run();
} catch (const std::exception& ex) {
......
......@@ -380,7 +380,7 @@ socketRequestor() {
}
void
initSocketReqeustor(cc::AbstractSession& session) {
initSocketRequestor(cc::AbstractSession& session) {
if (requestor != NULL) {
isc_throw(InvalidOperation,
"The socket requestor was already initialized");
......
......@@ -168,7 +168,7 @@ SocketRequestor& socketRequestor();
/// \param session the CC session that'll be used to talk to the
/// socket creator.
/// \throw InvalidOperation when it is called more than once
void initSocketReqeustor(cc::AbstractSession& session);
void initSocketRequestor(cc::AbstractSession& session);
/// \brief Initialization for tests
///
......
......@@ -83,7 +83,7 @@ public:
ElementPtr(new ListElement),
ElementPtr(new ListElement))
{
initSocketReqeustor(session);
initSocketRequestor(session);
}
~SocketRequestorTest() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment