[shibboleth-sp2] 43/89: SSPCPP-672 - Stop sorting endpoints in generated metadata by location

Ferenc Wágner wferi at moszumanska.debian.org
Thu Sep 1 09:24:07 UTC 2016


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

wferi pushed a commit to branch master
in repository shibboleth-sp2.

commit fce3aa939b6978db0dbf892a763b1c906e4833e6
Author: Scott Cantor <cantor.2 at osu.edu>
Date:   Thu Jun 2 23:41:18 2016 -0400

    SSPCPP-672 - Stop sorting endpoints in generated metadata by location
    
    https://issues.shibboleth.net/jira/browse/SSPCPP-672
---
 shibsp/impl/XMLServiceProvider.cpp | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/shibsp/impl/XMLServiceProvider.cpp b/shibsp/impl/XMLServiceProvider.cpp
index 5a985a9..20f94f8 100644
--- a/shibsp/impl/XMLServiceProvider.cpp
+++ b/shibsp/impl/XMLServiceProvider.cpp
@@ -1760,11 +1760,19 @@ const Handler* XMLApplication::getHandler(const char* path) const
 void XMLApplication::getHandlers(vector<const Handler*>& handlers) const
 {
     static void (vector<const Handler*>::* pb)(const Handler* const&) = &vector<const Handler*>::push_back;
+    // Copy all of the override's handlers.
     for_each(m_handlers.begin(), m_handlers.end(), boost::bind(pb, boost::ref(handlers), boost::bind(&boost::shared_ptr<Handler>::get, _1)));
     if (m_base) {
-        for (map<string,const Handler*>::const_iterator h = m_base->m_handlerMap.begin(); h != m_base->m_handlerMap.end(); ++h) {
-            if (m_handlerMap.count(h->first) == 0)
-                handlers.push_back(h->second);
+        if (handlers.empty()) {
+            // If the override doesn't supply any handlers, copy the parent's in normal order.
+            for_each(m_base->m_handlers.begin(), m_base->m_handlers.end(), boost::bind(pb, boost::ref(handlers), boost::bind(&boost::shared_ptr<Handler>::get, _1)));
+        }
+        else {
+            // This unfortunately distorts the usual ordering when it comes to metadata generation, but avoiding that would be a lot of code.
+            for (map<string, const Handler*>::const_iterator h = m_base->m_handlerMap.begin(); h != m_base->m_handlerMap.end(); ++h) {
+                if (m_handlerMap.count(h->first) == 0)
+                    handlers.push_back(h->second);
+            }
         }
     }
 }

-- 
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