X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fopensaml2.git;a=blobdiff_plain;f=saml%2Fsaml2%2Fmetadata%2Fimpl%2FChainingMetadataProvider.cpp;fp=saml%2Fsaml2%2Fmetadata%2Fimpl%2FChainingMetadataProvider.cpp;h=d0810d8f3f23fa056cdbd0e1861dc1c3059b2d02;hp=0fb651ffed0e0588d10809fd830c22ea0d438bfd;hb=1371b2bff9e177e14901da65fe72ca757d7b33b9;hpb=d72655ac98690a7459d74c5a74d45425845460a8 diff --git a/saml/saml2/metadata/impl/ChainingMetadataProvider.cpp b/saml/saml2/metadata/impl/ChainingMetadataProvider.cpp index 0fb651f..d0810d8 100644 --- a/saml/saml2/metadata/impl/ChainingMetadataProvider.cpp +++ b/saml/saml2/metadata/impl/ChainingMetadataProvider.cpp @@ -182,9 +182,7 @@ pair ChainingMetadataProvider::ge pair ret = pair(NULL,NULL); pair cur = ret; for (vector::const_iterator i=m_providers.begin(); i!=m_providers.end(); ++i) { - m_log.debug("locking embedded metadata provider (%p)", *i); (*i)->lock(); - m_log.debug("locked embedded metadata provider (%p)", *i); cur = (*i)->getEntityDescriptor(criteria); if (cur.first) { if (bRole) { @@ -192,9 +190,11 @@ pair ChainingMetadataProvider::ge 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); - m_log.debug("leaving embedded metadata provider locked (%p)", *i); return cur; } @@ -242,6 +242,10 @@ pair ChainingMetadataProvider::ge 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; @@ -270,9 +274,7 @@ pair ChainingMetadataProvider::ge } else { // No match, so just unlock this one and move on. - m_log.debug("unlocking embedded metadata provider (%p)", *i); (*i)->unlock(); - m_log.debug("unlocked embedded metadata provider (%p)", *i); } }