[cpp-sp] branch master updated: SSPCPP-350 - Modular configuration

Scott Cantor cantor.2 at osu.edu
Wed Apr 11 15:19:53 EDT 2018


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

scantor pushed a commit to branch master
in repository cpp-sp.

View the commit online:
http://git.shibboleth.net/view/?p=cpp-sp.git;a=commit;h=1756b9e4558d6edd964882b36bc28684057e0fc6

The following commit(s) were added to refs/heads/master by this push:
       new  1756b9e   SSPCPP-350 - Modular configuration
1756b9e is described below

commit 1756b9e4558d6edd964882b36bc28684057e0fc6
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Wed Apr 11 15:18:44 2018 -0400

    SSPCPP-350 - Modular configuration
    
    https://issues.shibboleth.net/jira/browse/SSPCPP-350
    
    Content-driven SP entityID override feature.
---
 adfs/adfs.cpp                                     |  4 +--
 plugins/AttributeResolverHandler.cpp              |  2 +-
 schemas/shibboleth-3.0-native-sp-config.xsd       |  1 +
 shibsp/handler/RemotedHandler.h                   |  8 +++++
 shibsp/handler/impl/AssertionConsumerService.cpp  |  2 +-
 shibsp/handler/impl/AssertionLookup.cpp           |  2 +-
 shibsp/handler/impl/DiscoveryFeed.cpp             |  2 +-
 shibsp/handler/impl/ExternalAuthHandler.cpp       |  2 +-
 shibsp/handler/impl/LocalLogoutInitiator.cpp      |  2 +-
 shibsp/handler/impl/MetadataGenerator.cpp         |  2 +-
 shibsp/handler/impl/RemotedHandler.cpp            | 10 ++++++
 shibsp/handler/impl/SAML2ArtifactResolution.cpp   |  2 +-
 shibsp/handler/impl/SAML2Logout.cpp               |  2 +-
 shibsp/handler/impl/SAML2LogoutInitiator.cpp      |  2 +-
 shibsp/handler/impl/SAML2NameIDMgmt.cpp           |  2 +-
 shibsp/handler/impl/SAML2SessionInitiator.cpp     |  2 +-
 shibsp/handler/impl/SAMLDSSessionInitiator.cpp    |  7 ++++-
 shibsp/handler/impl/Shib1SessionInitiator.cpp     |  2 +-
 shibsp/handler/impl/StatusHandler.cpp             |  2 +-
 shibsp/handler/impl/TransformSessionInitiator.cpp |  2 +-
 shibsp/handler/impl/WAYFSessionInitiator.cpp      |  7 ++++-
 shibsp/impl/XMLServiceProvider.cpp                | 38 +++++++++++++++++++++++
 shibsp/remoting/ListenerService.h                 | 20 ++++++++++++
 shibsp/remoting/impl/ListenerService.cpp          | 25 +++++++++++++--
 shibsp/remoting/impl/SocketListener.cpp           |  4 +--
 shibsp/util/DOMPropertySet.cpp                    |  1 -
 26 files changed, 131 insertions(+), 24 deletions(-)

diff --git a/adfs/adfs.cpp b/adfs/adfs.cpp
index 0bac60c..ed3d681 100644
--- a/adfs/adfs.cpp
+++ b/adfs/adfs.cpp
@@ -438,7 +438,7 @@ pair<bool,long> ADFSSessionInitiator::run(SPRequest& request, string& entityID,
         in.addmember("authnContextClassRef").string(acClass.second);
 
     // Remote the processing.
-    out = request.getServiceProvider().getListenerService()->send(in);
+    out = send(request, in);
     return unwrap(request, out);
 }
 
@@ -871,7 +871,7 @@ pair<bool,long> ADFSLogoutInitiator::run(SPRequest& request, bool isHandler) con
         headers.push_back("User-Agent");
         DDF out,in = wrap(request, &headers);
         DDFJanitor jin(in), jout(out);
-        out=request.getServiceProvider().getListenerService()->send(in);
+        out = send(request, in);
         return unwrap(request, out);
     }
 }
diff --git a/plugins/AttributeResolverHandler.cpp b/plugins/AttributeResolverHandler.cpp
index a7b7692..1c67548 100644
--- a/plugins/AttributeResolverHandler.cpp
+++ b/plugins/AttributeResolverHandler.cpp
@@ -210,7 +210,7 @@ pair<bool,long> AttributeResolverHandler::run(SPRequest& request, bool isHandler
             // When not out of process, we remote all the message processing.
             DDF out, in = wrap(request);
             DDFJanitor jin(in), jout(out);
-            out=request.getServiceProvider().getListenerService()->send(in);
+            out = send(request, in);
             return unwrap(request, out);
         }
     }
diff --git a/schemas/shibboleth-3.0-native-sp-config.xsd b/schemas/shibboleth-3.0-native-sp-config.xsd
index ae0473a..ffaffbb 100644
--- a/schemas/shibboleth-3.0-native-sp-config.xsd
+++ b/schemas/shibboleth-3.0-native-sp-config.xsd
@@ -274,6 +274,7 @@
     <attribute name="exportDuplicateValues" type="boolean"/>
     <attribute name="redirectToSSL" type="unsignedInt"/>
     <attribute name="entityID" type="anyURI"/>
+    <attribute name="entityIDSelf" type="anyURI"/>
     <attribute name="discoveryURL" type="anyURI"/>
     <attribute name="discoveryPolicy" type="conf:string"/>
     <attribute name="isPassive" type="boolean"/>
diff --git a/shibsp/handler/RemotedHandler.h b/shibsp/handler/RemotedHandler.h
index 4a73ac8..f8085d7 100644
--- a/shibsp/handler/RemotedHandler.h
+++ b/shibsp/handler/RemotedHandler.h
@@ -67,6 +67,14 @@ namespace shibsp {
         void setAddress(const char* address);
 
         /**
+        * Send a remoted message and return the response.
+        *
+        * @param in    input message to send
+        * @return      response from remote service
+        */
+        virtual DDF send(const SPRequest& request, DDF& in) const;
+
+        /**
          * Wraps a request by creating an outgoing data flow with the data needed
          * to remote the request information.
          *
diff --git a/shibsp/handler/impl/AssertionConsumerService.cpp b/shibsp/handler/impl/AssertionConsumerService.cpp
index 2ded160..4d54d8c 100644
--- a/shibsp/handler/impl/AssertionConsumerService.cpp
+++ b/shibsp/handler/impl/AssertionConsumerService.cpp
@@ -121,7 +121,7 @@ pair<bool,long> AssertionConsumerService::run(SPRequest& request, bool isHandler
         headers.push_back("Accept-Language");
         DDF out,in = wrap(request, &headers);
         DDFJanitor jin(in), jout(out);
-        out = request.getServiceProvider().getListenerService()->send(in);
+        out = send(request, in);
         return unwrap(request, out);
     }
 }
diff --git a/shibsp/handler/impl/AssertionLookup.cpp b/shibsp/handler/impl/AssertionLookup.cpp
index e125962..9c58b73 100644
--- a/shibsp/handler/impl/AssertionLookup.cpp
+++ b/shibsp/handler/impl/AssertionLookup.cpp
@@ -106,7 +106,7 @@ pair<bool,long> AssertionLookup::run(SPRequest& request, bool isHandler) const
             DDF out,in = wrap(request);
             DDFJanitor jin(in), jout(out);
 
-            out=request.getServiceProvider().getListenerService()->send(in);
+            out = send(request, in);
             return unwrap(request, out);
         }
     }
diff --git a/shibsp/handler/impl/DiscoveryFeed.cpp b/shibsp/handler/impl/DiscoveryFeed.cpp
index 3c70db2..02faa8b 100644
--- a/shibsp/handler/impl/DiscoveryFeed.cpp
+++ b/shibsp/handler/impl/DiscoveryFeed.cpp
@@ -186,7 +186,7 @@ pair<bool,long> DiscoveryFeed::run(SPRequest& request, bool isHandler) const
             if (!s.empty())
                 in.addmember("cache_tag").string(s.c_str());
             DDFJanitor jin(in), jout(out);
-            out = request.getServiceProvider().getListenerService()->send(in);
+            out = send(request, in);
             s.erase();
             if (m_dir.empty()) {
                 // The cache tag and feed are in the response struct.
diff --git a/shibsp/handler/impl/ExternalAuthHandler.cpp b/shibsp/handler/impl/ExternalAuthHandler.cpp
index 8c92837..30e2519 100644
--- a/shibsp/handler/impl/ExternalAuthHandler.cpp
+++ b/shibsp/handler/impl/ExternalAuthHandler.cpp
@@ -198,7 +198,7 @@ pair<bool,long> ExternalAuth::run(SPRequest& request, bool isHandler) const
             headers.push_back("Cookie");
             DDF out,in = wrap(request, &headers);
             DDFJanitor jin(in), jout(out);
-            out=request.getServiceProvider().getListenerService()->send(in);
+            out = send(request, in);
             return unwrap(request, out);
         }
     }
diff --git a/shibsp/handler/impl/LocalLogoutInitiator.cpp b/shibsp/handler/impl/LocalLogoutInitiator.cpp
index 5800d27..fe8146f 100644
--- a/shibsp/handler/impl/LocalLogoutInitiator.cpp
+++ b/shibsp/handler/impl/LocalLogoutInitiator.cpp
@@ -123,7 +123,7 @@ pair<bool,long> LocalLogoutInitiator::run(SPRequest& request, bool isHandler) co
         headers.push_back("User-Agent");
         DDF out,in = wrap(request,&headers);
         DDFJanitor jin(in), jout(out);
-        out=request.getServiceProvider().getListenerService()->send(in);
+        out = send(request, in);
         return unwrap(request, out);
     }
 }
diff --git a/shibsp/handler/impl/MetadataGenerator.cpp b/shibsp/handler/impl/MetadataGenerator.cpp
index acb5a4f..7bbecac 100644
--- a/shibsp/handler/impl/MetadataGenerator.cpp
+++ b/shibsp/handler/impl/MetadataGenerator.cpp
@@ -381,7 +381,7 @@ pair<bool,long> MetadataGenerator::run(SPRequest& request, bool isHandler) const
                 in.addmember("entity_id").string(request.getParameter("entityID"));
             DDFJanitor jin(in), jout(out);
 
-            out = request.getServiceProvider().getListenerService()->send(in);
+            out = send(request, in);
             return unwrap(request, out);
         }
     }
diff --git a/shibsp/handler/impl/RemotedHandler.cpp b/shibsp/handler/impl/RemotedHandler.cpp
index 8d2d4e4..4f8bec4 100644
--- a/shibsp/handler/impl/RemotedHandler.cpp
+++ b/shibsp/handler/impl/RemotedHandler.cpp
@@ -362,6 +362,16 @@ void RemotedHandler::addRemotedHeader(const char* header)
     m_remotedHeaders.insert(header);
 }
 
+DDF RemotedHandler::send(const SPRequest& request, DDF& in) const
+{
+    // Capture and forward entityIDSelf content setting, if set.
+    pair<bool, const char*> entityID = request.getRequestSettings().first->getString("entityIDSelf");
+    if (entityID.first)
+        in.addmember("_mapped.entityID").string(entityID.second);
+
+    return request.getServiceProvider().getListenerService()->send(in);
+}
+
 DDF RemotedHandler::wrap(const SPRequest& request, const vector<string>* headers, bool certs) const
 {
     DDF in = DDF(m_address.c_str()).structure();
diff --git a/shibsp/handler/impl/SAML2ArtifactResolution.cpp b/shibsp/handler/impl/SAML2ArtifactResolution.cpp
index acf7c08..4fe50d9 100644
--- a/shibsp/handler/impl/SAML2ArtifactResolution.cpp
+++ b/shibsp/handler/impl/SAML2ArtifactResolution.cpp
@@ -171,7 +171,7 @@ pair<bool,long> SAML2ArtifactResolution::run(SPRequest& request, bool isHandler)
             DDF out,in = wrap(request, nullptr, true);
             DDFJanitor jin(in), jout(out);
             
-            out = request.getServiceProvider().getListenerService()->send(in);
+            out = send(request, in);
             return unwrap(request, out);
         }
     }
diff --git a/shibsp/handler/impl/SAML2Logout.cpp b/shibsp/handler/impl/SAML2Logout.cpp
index 57ff2ea..5d649e5 100644
--- a/shibsp/handler/impl/SAML2Logout.cpp
+++ b/shibsp/handler/impl/SAML2Logout.cpp
@@ -227,7 +227,7 @@ pair<bool,long> SAML2Logout::run(SPRequest& request, bool isHandler) const
         headers.push_back("User-Agent");
         DDF out,in = wrap(request, &headers, true);
         DDFJanitor jin(in), jout(out);
-        out=request.getServiceProvider().getListenerService()->send(in);
+        out = send(request, in);
         return unwrap(request, out);
     }
 }
diff --git a/shibsp/handler/impl/SAML2LogoutInitiator.cpp b/shibsp/handler/impl/SAML2LogoutInitiator.cpp
index 2af104c..04fac01 100644
--- a/shibsp/handler/impl/SAML2LogoutInitiator.cpp
+++ b/shibsp/handler/impl/SAML2LogoutInitiator.cpp
@@ -226,7 +226,7 @@ pair<bool,long> SAML2LogoutInitiator::run(SPRequest& request, bool isHandler) co
         vector<string> headers(1,"Cookie");
         DDF out,in = wrap(request,&headers);
         DDFJanitor jin(in), jout(out);
-        out=request.getServiceProvider().getListenerService()->send(in);
+        out = send(request, in);
         return unwrap(request, out);
     }
 }
diff --git a/shibsp/handler/impl/SAML2NameIDMgmt.cpp b/shibsp/handler/impl/SAML2NameIDMgmt.cpp
index 9909385..62c8dbd 100644
--- a/shibsp/handler/impl/SAML2NameIDMgmt.cpp
+++ b/shibsp/handler/impl/SAML2NameIDMgmt.cpp
@@ -208,7 +208,7 @@ pair<bool,long> SAML2NameIDMgmt::run(SPRequest& request, bool isHandler) const
         headers.push_back("User-Agent");
         DDF out,in = wrap(request, &headers, true);
         DDFJanitor jin(in), jout(out);
-        out=request.getServiceProvider().getListenerService()->send(in);
+        out = send(request, in);
         return unwrap(request, out);
     }
 }
diff --git a/shibsp/handler/impl/SAML2SessionInitiator.cpp b/shibsp/handler/impl/SAML2SessionInitiator.cpp
index e526867..d9460cf 100644
--- a/shibsp/handler/impl/SAML2SessionInitiator.cpp
+++ b/shibsp/handler/impl/SAML2SessionInitiator.cpp
@@ -490,7 +490,7 @@ pair<bool,long> SAML2SessionInitiator::run(SPRequest& request, string& entityID,
         in.addmember("RelayState").unsafe_string(target.c_str());
 
     // Remote the processing.
-    out = request.getServiceProvider().getListenerService()->send(in);
+    out = send(request, in);
     return unwrap(request, out);
 }
 
diff --git a/shibsp/handler/impl/SAMLDSSessionInitiator.cpp b/shibsp/handler/impl/SAMLDSSessionInitiator.cpp
index 1d77698..9fb8019 100644
--- a/shibsp/handler/impl/SAMLDSSessionInitiator.cpp
+++ b/shibsp/handler/impl/SAMLDSSessionInitiator.cpp
@@ -272,7 +272,12 @@ pair<bool,long> SAMLDSSessionInitiator::run(SPRequest& request, string& entityID
          }
     }
 
-    string req=string(discoveryURL.second) + (strchr(discoveryURL.second,'?') ? '&' : '?') + "entityID=" + urlenc->encode(app.getString("entityID").second) +
+    // Check for content-specific SP entityID before falling back to app default.
+    prop = getString("entityIDSelf", request, HANDLER_PROPERTY_MAP);
+    if (!prop.first)
+    	prop = app.getString("entityID");
+
+    string req=string(discoveryURL.second) + (strchr(discoveryURL.second,'?') ? '&' : '?') + "entityID=" + urlenc->encode(prop.second) +
         "&return=" + urlenc->encode(returnURL.c_str());
     if (m_returnParam)
         req = req + "&returnIDParam=" + m_returnParam;
diff --git a/shibsp/handler/impl/Shib1SessionInitiator.cpp b/shibsp/handler/impl/Shib1SessionInitiator.cpp
index 83acb1d..4998f45 100644
--- a/shibsp/handler/impl/Shib1SessionInitiator.cpp
+++ b/shibsp/handler/impl/Shib1SessionInitiator.cpp
@@ -219,7 +219,7 @@ pair<bool,long> Shib1SessionInitiator::run(SPRequest& request, string& entityID,
         in.addmember("RelayState").unsafe_string(target.c_str());
 
     // Remote the processing. Our unwrap method will handle POST data if necessary.
-    out = request.getServiceProvider().getListenerService()->send(in);
+    out = send(request, in);
     return unwrap(request, out);
 }
 
diff --git a/shibsp/handler/impl/StatusHandler.cpp b/shibsp/handler/impl/StatusHandler.cpp
index 2128636..0e60562 100644
--- a/shibsp/handler/impl/StatusHandler.cpp
+++ b/shibsp/handler/impl/StatusHandler.cpp
@@ -305,7 +305,7 @@ pair<bool,long> StatusHandler::run(SPRequest& request, bool isHandler) const
             // When not out of process, we remote all the message processing.
             DDF out,in = wrap(request);
             DDFJanitor jin(in), jout(out);
-            out=request.getServiceProvider().getListenerService()->send(in);
+            out = send(request, in);
             return unwrap(request, out);
         }
     }
diff --git a/shibsp/handler/impl/TransformSessionInitiator.cpp b/shibsp/handler/impl/TransformSessionInitiator.cpp
index a980b3c..31cb1fb 100644
--- a/shibsp/handler/impl/TransformSessionInitiator.cpp
+++ b/shibsp/handler/impl/TransformSessionInitiator.cpp
@@ -176,7 +176,7 @@ pair<bool,long> TransformSessionInitiator::run(SPRequest& request, string& entit
         in.addmember("entity_id").string(entityID.c_str());
     
         // Remote the processing.
-        out = request.getServiceProvider().getListenerService()->send(in);
+        out = send(request, in);
         if (out.isstring())
             entityID = out.string();
     }
diff --git a/shibsp/handler/impl/WAYFSessionInitiator.cpp b/shibsp/handler/impl/WAYFSessionInitiator.cpp
index e26f18d..2e1d084 100644
--- a/shibsp/handler/impl/WAYFSessionInitiator.cpp
+++ b/shibsp/handler/impl/WAYFSessionInitiator.cpp
@@ -177,10 +177,15 @@ pair<bool,long> WAYFSessionInitiator::run(SPRequest& request, string& entityID,
     if (target.empty())
         target = "default";
 
+    // Check for content-specific SP entityID before falling back to app default.
+    prop = getString("entityIDSelf", request, HANDLER_PROPERTY_MAP);
+    if (!prop.first)
+    	prop = app.getString("entityID");
+
     const URLEncoder* urlenc = XMLToolingConfig::getConfig().getURLEncoder();
     string req=string(discoveryURL.second) + (strchr(discoveryURL.second,'?') ? '&' : '?') + "shire=" + urlenc->encode(ACSloc.c_str()) +
         "&time=" + lexical_cast<string>(time(nullptr)) + "&target=" + urlenc->encode(target.c_str()) +
-        "&providerId=" + urlenc->encode(app.getString("entityID").second);
+        "&providerId=" + urlenc->encode(prop.second);
 
     return make_pair(true, request.sendRedirect(req.c_str()));
 }
diff --git a/shibsp/impl/XMLServiceProvider.cpp b/shibsp/impl/XMLServiceProvider.cpp
index 96b3824..16e8a91 100644
--- a/shibsp/impl/XMLServiceProvider.cpp
+++ b/shibsp/impl/XMLServiceProvider.cpp
@@ -170,6 +170,10 @@ namespace {
         const vector<const XMLCh*>* getAudiences() const {
             return (m_audiences.empty() && m_base) ? m_base->getAudiences() : &m_audiences;
         }
+
+        // PropertySet overrides.
+        pair<bool, const char*> getString(const char* name, const char* ns = nullptr) const;
+        pair<bool, const XMLCh*> getXMLString(const char* name, const char* ns = nullptr) const;
 #endif
         string getNotificationURL(const char* resource, bool front, unsigned int index) const;
 
@@ -1550,6 +1554,40 @@ DOMNodeFilter::FilterAction XMLApplication::acceptNode(const DOMNode* node) cons
 
 #ifndef SHIBSP_LITE
 
+pair<bool, const char*> XMLApplication::getString(const char* name, const char* ns) const
+{
+    if (!SPConfig::getConfig().isEnabled(SPConfig::InProcess)) {
+        if (!ns && !strcmp(name, "entityID")) {
+            const ListenerService* listener = getServiceProvider().getListenerService(false);
+            DDF* in = listener ? listener->getInput() : nullptr;
+            if (in) {
+                const char* entityID = in->getmember("_mapped")["entityID"].string();
+                if (entityID)
+                    return make_pair(true, entityID);
+            }
+        }
+    }
+
+    return DOMPropertySet::getString(name, ns);
+}
+
+pair<bool, const XMLCh*> XMLApplication::getXMLString(const char* name, const char* ns) const
+{
+    if (!SPConfig::getConfig().isEnabled(SPConfig::InProcess)) {
+        if (!ns && !strcmp(name, "entityID")) {
+            const ListenerService* listener = getServiceProvider().getListenerService(false);
+            DDF* in = listener ? listener->getInput() : nullptr;
+            if (in) {
+                void* entityID = in->getmember("_mapped")["entityID-16"].pointer();
+                if (entityID)
+                    return make_pair(true, reinterpret_cast<const XMLCh*>(entityID));
+            }
+        }
+    }
+
+    return DOMPropertySet::getXMLString(name, ns);
+}
+
 const PropertySet* XMLApplication::getRelyingParty(const EntityDescriptor* provider) const
 {
     if (!provider)
diff --git a/shibsp/remoting/ListenerService.h b/shibsp/remoting/ListenerService.h
index 56a357b..8f5b2ef 100644
--- a/shibsp/remoting/ListenerService.h
+++ b/shibsp/remoting/ListenerService.h
@@ -28,7 +28,13 @@
 #define __shibsp_listener_h__
 
 #include <shibsp/remoting/ddf.h>
+
 #include <map>
+#include <boost/scoped_ptr.hpp>
+
+namespace xmltooling {
+    class ThreadKey;
+}
 
 namespace shibsp {
 
@@ -89,8 +95,21 @@ namespace shibsp {
          */
         virtual DDF send(const DDF& in)=0;
 
+        /**
+        * Receive a remoted message and write the response.
+        *
+        * @param in    input message
+        * @param out   output stream to write to
+        */
         void receive(DDF& in, std::ostream& out);
 
+        /**
+         * Access the input message being processed by the active worker thread.
+         *
+         * @return a reference to the input object
+         */
+        DDF* getInput() const;
+
         // Remoted classes register and unregister for messages using these methods.
         // Registration returns any existing listeners, allowing message hooking.
 
@@ -150,6 +169,7 @@ namespace shibsp {
 
     private:
         std::map<std::string,Remoted*> m_listenerMap;
+        boost::scoped_ptr<xmltooling::ThreadKey> m_threadLocalKey;
     };
 
 #if defined (_MSC_VER)
diff --git a/shibsp/remoting/impl/ListenerService.cpp b/shibsp/remoting/impl/ListenerService.cpp
index 174c812..386943e 100644
--- a/shibsp/remoting/impl/ListenerService.cpp
+++ b/shibsp/remoting/impl/ListenerService.cpp
@@ -31,6 +31,7 @@
 
 #include <xercesc/dom/DOM.hpp>
 #include <xmltooling/security/SecurityHelper.h>
+#include <xmltooling/util/Threads.h>
 
 using namespace shibsp;
 using namespace xmltooling;
@@ -61,7 +62,7 @@ Remoted::~Remoted()
 {
 }
 
-ListenerService::ListenerService()
+ListenerService::ListenerService() : m_threadLocalKey(ThreadKey::create(nullptr))
 {
 }
 
@@ -136,7 +137,27 @@ void ListenerService::receive(DDF &in, ostream& out)
             throw ListenerException("No destination registered for incoming message addressed to ($1).", params(1,in.name()));
     }
 
-    dest->receive(in, out);
+    try {
+        // Input is saved for surreptitious access by components without direct API access to the data.
+        m_threadLocalKey->setData(&in);
+        auto_ptr_XMLCh selfEntityID(in["_mapped.entityID"].string());
+        if (selfEntityID.get()) {
+            in.addmember("_mapped.entityID-16").pointer(const_cast<XMLCh*>(selfEntityID.get()));
+        }
+
+        dest->receive(in, out);
+        m_threadLocalKey->setData(nullptr);
+    }
+    catch (...) {
+        // Clear on error.
+        m_threadLocalKey->setData(nullptr);
+        throw;
+    }
+}
+
+DDF* ListenerService::getInput() const
+{
+    return reinterpret_cast<DDF*>(m_threadLocalKey->getData());
 }
 
 bool ListenerService::init(bool force)
diff --git a/shibsp/remoting/impl/SocketListener.cpp b/shibsp/remoting/impl/SocketListener.cpp
index 37a6716..132579b 100644
--- a/shibsp/remoting/impl/SocketListener.cpp
+++ b/shibsp/remoting/impl/SocketListener.cpp
@@ -546,14 +546,14 @@ int ServerThread::job()
         // Dispatch the message.
         m_listener->receive(in, sink);
     }
-    catch (XMLToolingException& e) {
+    catch (const XMLToolingException& e) {
         if (incomingError)
             log.error("error processing incoming message: %s", e.what());
         DDF out=DDF("exception").string(e.toString().c_str());
         DDFJanitor jout(out);
         sink << out;
     }
-    catch (exception& e) {
+    catch (const exception& e) {
         if (incomingError)
             log.error("error processing incoming message: %s", e.what());
         ListenerException ex(e.what());
diff --git a/shibsp/util/DOMPropertySet.cpp b/shibsp/util/DOMPropertySet.cpp
index d51fb9c..ccf84c1 100644
--- a/shibsp/util/DOMPropertySet.cpp
+++ b/shibsp/util/DOMPropertySet.cpp
@@ -218,7 +218,6 @@ pair<bool,bool> DOMPropertySet::getBool(const char* name, const char* ns) const
 
 pair<bool,const char*> DOMPropertySet::getString(const char* name, const char* ns) const
 {
-    pair<bool,const char*> ret(false,nullptr);
     map< string,pair<char*,const XMLCh*> >::const_iterator i;
 
     if (ns)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list