Parcourir la source

[trac999] make sure all initial configuration is loaded at initialization.
the main purpose of this change is for query ACL, but it also eliminates
the need for hardcoding the default listen_on setting.

JINMEI Tatuya il y a 14 ans
Parent
commit
181283a529
2 fichiers modifiés avec 4 ajouts et 9 suppressions
  1. 4 0
      src/bin/resolver/main.cc
  2. 0 9
      src/bin/resolver/resolver.cc

+ 4 - 0
src/bin/resolver/main.cc

@@ -218,6 +218,10 @@ main(int argc, char* argv[]) {
         }
 
         resolver->setConfigSession(config_session);
+        // Install all initial configurations.  If loading configuration
+        // fails, it will be logged, but we start the server anyway, giving
+        // the user a second chance to correct the configuration.
+        resolver->updateConfig(config_session->getFullConfig());
         LOG_DEBUG(resolver_logger, RESOLVER_DBG_INIT, RESOLVER_CONFIGLOAD);
 
         LOG_INFO(resolver_logger, RESOLVER_STARTED);

+ 0 - 9
src/bin/resolver/resolver.cc

@@ -668,15 +668,6 @@ Resolver::updateConfig(ConstElementPtr config) {
         if (listenAddressesE) {
             setListenAddresses(listenAddresses);
             need_query_restart = true;
-        } else {
-            if (!configured_) {
-                // TODO: ModuleSpec needs getDefault()
-                AddressList initial_addresses;
-                initial_addresses.push_back(AddressPair("127.0.0.1", 53));
-                initial_addresses.push_back(AddressPair("::1", 53));
-                setListenAddresses(initial_addresses);
-                need_query_restart = true;
-            }
         }
         if (forwardAddressesE) {
             setForwardAddresses(forwardAddresses);