From: cantor Date: Mon, 28 Jan 2008 21:35:17 +0000 (+0000) Subject: Move metadata lock outside of else clause. X-Git-Tag: 2.4~578 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fsp.git;a=commitdiff_plain;h=db3dd0f8110b3daa89123ef9994dc86121a92b31 Move metadata lock outside of else clause. git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/trunk@2708 cb58f699-b61c-0410-a6fe-9272a202ed29 --- 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) {