Move metadata lock outside of else clause.
authorcantor <cantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Mon, 28 Jan 2008 21:35:17 +0000 (21:35 +0000)
committercantor <cantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Mon, 28 Jan 2008 21:35:17 +0000 (21:35 +0000)
git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/trunk@2708 cb58f699-b61c-0410-a6fe-9272a202ed29

shibsp/handler/impl/SAML2SessionInitiator.cpp

index e6efdd8..6556f0a 100644 (file)
@@ -492,6 +492,10 @@ pair<bool,long> SAML2SessionInitiator::doRequest(
     const IDPSSODescriptor* role = NULL;
     const EndpointType* ep = NULL;
     const MessageEncoder* encoder = NULL;
     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;
     
     if (ECP) {
         encoder = m_ecp;
@@ -502,8 +506,6 @@ pair<bool,long> SAML2SessionInitiator::doRequest(
     }
     else {
         // Use metadata to locate the IdP's SSO service.
     }
     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) {
         MetadataProvider::Criteria mc(entityID, &IDPSSODescriptor::ELEMENT_QNAME, samlconstants::SAML20P_NS);
         entity=m->getEntityDescriptor(mc);
         if (!entity.first) {