Browse Source

[trac736] a few cleanups

Jelte Jansen 14 years ago
parent
commit
5638c66218

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

@@ -221,7 +221,6 @@ main(int argc, char* argv[]) {
         LOG_DEBUG(resolver_logger, RESOLVER_DBG_INIT, RESOLVER_CONFIGLOAD);
         LOG_DEBUG(resolver_logger, RESOLVER_DBG_INIT, RESOLVER_CONFIGLOAD);
 
 
         LOG_INFO(resolver_logger, RESOLVER_STARTED);
         LOG_INFO(resolver_logger, RESOLVER_STARTED);
-
         io_service.run();
         io_service.run();
     } catch (const std::exception& ex) {
     } catch (const std::exception& ex) {
         LOG_FATAL(resolver_logger, RESOLVER_FAILED).arg(ex.what());
         LOG_FATAL(resolver_logger, RESOLVER_FAILED).arg(ex.what());

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

@@ -639,12 +639,6 @@ Resolver::updateConfig(ConstElementPtr config) {
 }
 }
 
 
 void
 void
-Resolver::updateLoggingConfig(ConstElementPtr config) {
-    std::cout << "[XX] Got new logger config: " << std::endl;
-    std::cout << config->str() << std::endl;
-}
-
-void
 Resolver::setForwardAddresses(const AddressList& addresses)
 Resolver::setForwardAddresses(const AddressList& addresses)
 {
 {
     impl_->setForwardAddresses(addresses, dnss_);
     impl_->setForwardAddresses(addresses, dnss_);

+ 0 - 2
src/bin/resolver/resolver.h

@@ -95,8 +95,6 @@ public:
     /// \brief Handle commands from the config session
     /// \brief Handle commands from the config session
     isc::data::ConstElementPtr updateConfig(isc::data::ConstElementPtr config);
     isc::data::ConstElementPtr updateConfig(isc::data::ConstElementPtr config);
 
 
-    void updateLoggingConfig(isc::data::ConstElementPtr config);
-
     /// \brief Assign an ASIO IO Service queue to this Resolver object
     /// \brief Assign an ASIO IO Service queue to this Resolver object
     void setDNSService(isc::asiodns::DNSService& dnss);
     void setDNSService(isc::asiodns::DNSService& dnss);
 
 

+ 6 - 3
src/lib/config/config_data.cc

@@ -49,11 +49,13 @@ find_spec_part(ConstElementPtr spec, const std::string& identifier) {
     while(sep != std::string::npos) {
     while(sep != std::string::npos) {
         std::string part = id.substr(0, sep);
         std::string part = id.substr(0, sep);
 
 
+        // As long as we are not in the 'final' element as specified
+        // by the identifier, we want to automatically traverse list
+        // and map specifications
         while (spec_part->getType() == Element::map && 
         while (spec_part->getType() == Element::map && 
                (spec_part->contains("list_item_spec") ||
                (spec_part->contains("list_item_spec") ||
                 spec_part->contains("map_item_spec"))) {
                 spec_part->contains("map_item_spec"))) {
             if (spec_part->contains("list_item_spec")) {
             if (spec_part->contains("list_item_spec")) {
-                std::cout << "[XX] traversing list item " << id << std::endl;
                 spec_part = spec_part->get("list_item_spec");
                 spec_part = spec_part->get("list_item_spec");
             } else {
             } else {
                 spec_part = spec_part->get("map_item_spec");
                 spec_part = spec_part->get("map_item_spec");
@@ -108,11 +110,12 @@ find_spec_part(ConstElementPtr spec, const std::string& identifier) {
                     isc_throw(DataNotFoundError, id + " in " + identifier + " not found");
                     isc_throw(DataNotFoundError, id + " in " + identifier + " not found");
                 }
                 }
             } else {
             } else {
-                isc_throw(DataNotFoundError, "Element above " + id + " in " + identifier + " is not a map");
+                isc_throw(DataNotFoundError, "Element above " + id +
+                                             " in " + identifier +
+                                             " is not a map");
             }
             }
         }
         }
     }
     }
-    std::cout << "[XX] RETURNING SPEC PART FOR '" << identifier << "': " << spec_part->str() << std::endl;
     return (spec_part);
     return (spec_part);
 }
 }
 
 

+ 3 - 1
src/lib/config/tests/ccsession_unittests.cc

@@ -351,7 +351,9 @@ int remote_item1(0);
 ConstElementPtr remote_config;
 ConstElementPtr remote_config;
 ModuleCCSession *remote_mccs(NULL);
 ModuleCCSession *remote_mccs(NULL);
 
 
-void remoteHandler(const std::string& module_name, ConstElementPtr config, const ConfigData&) {
+void remoteHandler(const std::string& module_name,
+                   ConstElementPtr config,
+                   const ConfigData&) {
     remote_module_name = module_name;
     remote_module_name = module_name;
     remote_item1 = remote_mccs->getRemoteConfigValue("Spec2", "item1")->
     remote_item1 = remote_mccs->getRemoteConfigValue("Spec2", "item1")->
         intValue();
         intValue();

+ 0 - 7
src/lib/config/tests/config_data_unittests.cc

@@ -56,16 +56,9 @@ TEST(ConfigData, getValue) {
     EXPECT_EQ("a", cd.getValue(is_default, "value5")->get(0)->stringValue());
     EXPECT_EQ("a", cd.getValue(is_default, "value5")->get(0)->stringValue());
     EXPECT_TRUE(is_default);
     EXPECT_TRUE(is_default);
     EXPECT_EQ("b", cd.getValue("value5")->get(1)->stringValue());
     EXPECT_EQ("b", cd.getValue("value5")->get(1)->stringValue());
-    std::cout << "[XX] full: " << cd.getFullConfig()->str() << std::endl;
-    std::cout << "[XX] 1" << std::endl;
-    std::cout << "[XX] value5: " << cd.getValue(is_default, "value5")->str() << std::endl;
     EXPECT_EQ("b", cd.getValue(is_default, "value5")->get(1)->stringValue());
     EXPECT_EQ("b", cd.getValue(is_default, "value5")->get(1)->stringValue());
-    std::cout << "[XX] 2" << std::endl;
-    std::cout << "[XX] value5/:" << cd.getValue(is_default, "value5/")->str() << std::endl;
     EXPECT_EQ("b", cd.getValue(is_default, "value5/")->get(1)->stringValue());
     EXPECT_EQ("b", cd.getValue(is_default, "value5/")->get(1)->stringValue());
-    std::cout << "[XX] 3" << std::endl;
     EXPECT_TRUE(is_default);
     EXPECT_TRUE(is_default);
-    std::cout << "[XX] 4" << std::endl;
     EXPECT_EQ("{  }", cd.getValue("value6")->str());
     EXPECT_EQ("{  }", cd.getValue("value6")->str());
     EXPECT_EQ("{  }", cd.getValue(is_default, "value6")->str());
     EXPECT_EQ("{  }", cd.getValue(is_default, "value6")->str());
     EXPECT_EQ("{  }", cd.getValue(is_default, "value6/")->str());
     EXPECT_EQ("{  }", cd.getValue(is_default, "value6/")->str());

+ 0 - 29
src/lib/log/debug_levels.h

@@ -1,29 +0,0 @@
-// Copyright (C) 2011  Internet Systems Consortium, Inc. ("ISC")
-//
-// Permission to use, copy, modify, and/or distribute this software for any
-// purpose with or without fee is hereby granted, provided that the above
-// copyright notice and this permission notice appear in all copies.
-//
-// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-// PERFORMANCE OF THIS SOFTWARE.
-
-#ifndef __DEBUG_LEVELS_H
-#define __DEBUG_LEVELS_H
-
-/// \brief Defines Debug Levels
-///
-/// Defines the maximum and minimum debug levels and the number of levels.
-/// These are defined using #define as they are referenced in the construction
-/// of variables declared outside execution units.  (In this way we avoid the
-/// "static initialization fiasco" problem.)
-
-#define MIN_DEBUG_LEVEL (0)
-#define MAX_DEBUG_LEVEL (99)
-#define NUM_DEBUG_LEVEL (MAX_DEBUG_LEVEL - MIN_DEBUG_LEVEL + 1)
-
-#endif // __DEBUG_LEVELS_H

+ 1 - 0
src/lib/log/output_option.h

@@ -78,6 +78,7 @@ struct OutputOption {
 OutputOption::Destination getDestination(const std::string& dest_str);
 OutputOption::Destination getDestination(const std::string& dest_str);
 OutputOption::Stream getStream(const std::string& stream_str);
 OutputOption::Stream getStream(const std::string& stream_str);
 
 
+
 } // namespace log
 } // namespace log
 } // namespace isc
 } // namespace isc