Subject: [dtn-users] namespace bug patch

From: Lana Black <[email-masked]>
Date: Fri, 15 Mar 2013 17:51:31 +0000

Hi,

Turned out my last patch didnt fix the issue entirely, and several
errors were left in the BSP code which I didnt check.

Also, dtn::KeyDB::shutdown() method was defined twice for some reason,
the patch removes the older definition.

With best regards.
diff --git a/servlib/security/KeyDB.cc b/servlib/security/KeyDB.cc
index 83508fc..83f32d9 100644
--- a/servlib/security/KeyDB.cc
+++ b/servlib/security/KeyDB.cc
@@ -31,10 +31,10 @@
 #include "KeyDB.h"
 #include "Ciphersuite.h"
 
-namespace dtn {
-
 template <>
-KeyDB* oasys::Singleton<KeyDB, false>::instance_ = NULL;
+dtn::KeyDB* oasys::Singleton<dtn::KeyDB, false>::instance_ = NULL;
+
+namespace dtn {
 
 static const char * log = "/dtn/bundle/security";
 
@@ -60,15 +60,6 @@ KeyDB::init()
 
 void KeyDB::shutdown()
 {
-    if(instance_ != NULL) 
-    {
-        delete instance_;
-        log_debug_p(log, "KeyDB::shutdown() completed");
-    }
-}
-
-void KeyDB::shutdown()
-{
     if(instance_ != NULL && !getenv("OASYS_CLEANUP_SINGLETONS")) 
     {
         delete instance_;
diff --git a/servlib/security/SPD.cc b/servlib/security/SPD.cc
index 19d5dc7..2ee7e6e 100644
--- a/servlib/security/SPD.cc
+++ b/servlib/security/SPD.cc
@@ -28,10 +28,10 @@
 #include "Ciphersuite_ES4.h"
 #include "SecurityPolicy.h"
 
-namespace dtn {
-
 template <>
-SPD* oasys::Singleton<SPD, false>::instance_ = NULL;
+dtn::SPD* oasys::Singleton<dtn::SPD, false>::instance_ = NULL;
+
+namespace dtn {
 
 static const char * log = "/dtn/bundle/security";