From db3dd0f8110b3daa89123ef9994dc86121a92b31 Mon Sep 17 00:00:00 2001 From: cantor Date: Mon, 28 Jan 2008 21:35:17 +0000 Subject: [PATCH] Move metadata lock outside of else clause. git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/trunk@2708 cb58f699-b61c-0410-a6fe-9272a202ed29 --- shibsp/handler/impl/SAML2SessionInitiator.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/shibsp/handler/impl/SAML2SessionInitiator.cpp b/shibsp/handler/impl/SAML2SessionInitiator.cpp index e6efdd8..6556f0a 100644 --- a/shibsp/handler/impl/SAML2SessionInitiator.cpp +++ b/shibsp/handler/impl/SAML2SessionInitiator.cpp @@ -492,6 +492,10 @@ pair SAML2SessionInitiator::doRequest( const IDPSSODescriptor* role = NULL; const EndpointType* ep = NULL; const MessageEncoder* encoder = NULL; + + // We won't need this for ECP, but safety dictates we get the lock here. + MetadataProvider* m=app.getMetadataProvider(); + Locker locker(m); if (ECP) { encoder = m_ecp; @@ -502,8 +506,6 @@ pair SAML2SessionInitiator::doRequest( } else { // Use metadata to locate the IdP's SSO service. - MetadataProvider* m=app.getMetadataProvider(); - Locker locker(m); MetadataProvider::Criteria mc(entityID, &IDPSSODescriptor::ELEMENT_QNAME, samlconstants::SAML20P_NS); entity=m->getEntityDescriptor(mc); if (!entity.first) { -- 2.1.4