Browse Source

[master] Merge branch 'trac1546'

JINMEI Tatuya 13 years ago
parent
commit
5589ea8da0

+ 5 - 3
src/bin/auth/main.cc

@@ -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);

+ 8 - 2
src/bin/resolver/main.cc

@@ -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) {

+ 1 - 1
src/lib/server_common/socket_request.cc

@@ -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");

+ 1 - 1
src/lib/server_common/socket_request.h

@@ -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
 ///

+ 1 - 1
src/lib/server_common/tests/socket_requestor_test.cc

@@ -83,7 +83,7 @@ public:
                                     ElementPtr(new ListElement),
                                     ElementPtr(new ListElement))
     {
-        initSocketReqeustor(session);
+        initSocketRequestor(session);
     }
 
     ~SocketRequestorTest() {