#include "saml/binding/SAMLArtifact.h"
#include "saml2/metadata/ChainingMetadataProvider.h"
+#include <memory>
#include <xercesc/util/XMLUniDefs.hpp>
#include <xmltooling/logging.h>
#include <xmltooling/util/XMLHelper.h>
pair<const EntityDescriptor*,const RoleDescriptor*> ChainingMetadataProvider::getEntityDescriptor(const Criteria& criteria) const
{
- bool bRole = (criteria.role && criteria.protocol); // searching for role also?
-
// Clear any existing lock.
const_cast<ChainingMetadataProvider*>(this)->unlock();
(*i)->lock();
cur = (*i)->getEntityDescriptor(criteria);
if (cur.first) {
- if (bRole) {
+ if (criteria.role) {
// We want a role also. Did we find one?
if (cur.second) {
// Are we using a first match policy?
if (m_firstMatch) {
+ // We could have an entity-only match from earlier, so unlock it.
+ if (held)
+ held->unlock();
// Save locked provider.
m_tlsKey->setData(*i);
return cur;
else {
// Are we using a first match policy?
if (m_firstMatch) {
+ // I don't think this can happen, but who cares, check anyway.
+ if (held)
+ held->unlock();
+
// Save locked provider.
m_tlsKey->setData(*i);
return cur;