[shibboleth-sp2] 98/119: Remove useless logging and private class.

Ferenc Wágner wferi-guest at moszumanska.debian.org
Tue Jan 26 21:29:54 UTC 2016


This is an automated email from the git hooks/post-receive script.

wferi-guest pushed a commit to annotated tag 1.3.1
in repository shibboleth-sp2.

commit 2489395116030d88905a01d239ab8a1c11e55250
Author: Scott Cantor <cantor.2 at osu.edu>
Date:   Tue Oct 30 15:39:03 2007 +0000

    Remove useless logging and private class.
---
 shib-target/internal.h   | 25 +++++++++++++------------
 shib-target/shib-mlp.cpp | 39 +++------------------------------------
 2 files changed, 16 insertions(+), 48 deletions(-)

diff --git a/shib-target/internal.h b/shib-target/internal.h
index 5638bb5..52893e9 100644
--- a/shib-target/internal.h
+++ b/shib-target/internal.h
@@ -159,28 +159,28 @@ namespace shibtarget {
     };
 
     // Error template class
-    class ShibMLPPriv;
     class ShibMLP {
     public:
-        ShibMLP();
-        ~ShibMLP();
+        ShibMLP() {}
+        ~ShibMLP() {}
 
-        void insert (const std::string& key, const std::string& value);
+        void insert (const std::string& key, const std::string& value) {
+            m_map[key] = value;
+        }
         void insert (const std::string& key, const char* value) {
-          std::string v = value;
-          insert (key, v);
+            m_map[key] = value;
         }
         void insert (const char* key, const std::string& value) {
-          std::string k = key;
-          insert (k, value);
+            m_map[key] = value;
         }
         void insert (const char* key, const char* value) {
-          std::string k = key, v = value;
-          insert(k,v);
+            m_map[key] = value;
         }
         void insert (saml::SAMLException& e);
 
-        void clear () { m_map.clear(); }
+        void clear () {
+            m_map.clear();
+        }
 
         const char* run (std::istream& s, const IPropertySet* props=NULL, std::string* output=NULL);
         const char* run (const std::string& input, const IPropertySet* props=NULL, std::string* output=NULL);
@@ -190,7 +190,8 @@ namespace shibtarget {
         }
 
     private:
-        ShibMLPPriv *m_priv;
+        static void html_encode(std::string& os, const char* start);
+
         std::map<std::string,std::string> m_map;
         std::string m_generated;
     };
diff --git a/shib-target/shib-mlp.cpp b/shib-target/shib-mlp.cpp
index 324f934..e34d22d 100644
--- a/shib-target/shib-mlp.cpp
+++ b/shib-target/shib-mlp.cpp
@@ -32,19 +32,8 @@ using namespace std;
 using namespace saml;
 using namespace shibboleth;
 using namespace shibtarget;
-using namespace shibtarget::logging;
 
-class shibtarget::ShibMLPPriv {
-public:
-  ShibMLPPriv();
-  ~ShibMLPPriv() {}
-  Category *log;
-
-  static void html_encode(string& os, const char* start);
-};  
-
-
-void ShibMLPPriv::html_encode(string& os, const char* start)
+void ShibMLP::html_encode(string& os, const char* start)
 {
     while (start && *start) {
         switch (*start) {
@@ -70,8 +59,6 @@ void ShibMLPPriv::html_encode(string& os, const char* start)
     }
 }
 
-ShibMLPPriv::ShibMLPPriv() : log(&(Category::getInstance("shibtarget.ShibMLP"))) {}
-
 static void trimspace (string& s)
 {
   int end = s.size() - 1, start = 0;
@@ -86,16 +73,6 @@ static void trimspace (string& s)
   s = s.substr(start, end - start + 1);
 }
 
-ShibMLP::ShibMLP()
-{
-  m_priv = new ShibMLPPriv ();
-}
-
-ShibMLP::~ShibMLP ()
-{
-  delete m_priv;
-}
-
 const char* ShibMLP::run(const string& is, const IPropertySet* props, std::string* output)
 {
   // Create a timestamp
@@ -113,8 +90,6 @@ const char* ShibMLP::run(const string& is, const IPropertySet* props, std::strin
   const char* lastpos = line;
   const char* thispos;
 
-  m_priv->log->debug("Processing string");
-
   //
   // Search for SHIBMLP tags.  These are of the form:
   //	<shibmlp key/>
@@ -145,12 +120,12 @@ const char* ShibMLP::run(const string& is, const IPropertySet* props, std::strin
     
             map<string,string>::const_iterator i=m_map.find(key);
             if (i != m_map.end()) {
-                m_priv->html_encode(*output,i->second.c_str());
+                html_encode(*output,i->second.c_str());
             }
             else {
                 pair<bool,const char*> p=props ? props->getString(key.c_str()) : pair<bool,const char*>(false,NULL);
                 if (p.first) {
-                    m_priv->html_encode(*output,p.second);
+                    html_encode(*output,p.second);
                 }
                 else {
                     static const char* s1 = "<!-- Unknown SHIBMLP key: ";
@@ -278,8 +253,6 @@ const char* ShibMLP::run(istream& is, const IPropertySet* props, std::string* ou
   static string eol = "\r\n";
   string str, line;
 
-  m_priv->log->debug("processing stream");
-
   while (getline(is, line))
     str += line + eol;
 
@@ -305,9 +278,3 @@ void ShibMLP::insert(SAMLException& e)
             insert("originContactEmail", email);
     }
 }
-
-void ShibMLP::insert (const std::string& key, const std::string& value)
-{
-  m_priv->log->debug("inserting %s -> %s", key.c_str(), value.c_str());
-  m_map[key] = value;
-}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-shibboleth/shibboleth-sp2.git



More information about the Pkg-shibboleth-devel mailing list