From 751fd4bbf3ae3ff9c32bb2a28adcab56f41ff274 Mon Sep 17 00:00:00 2001 From: Scott Cantor Date: Fri, 9 Nov 2007 06:23:08 +0000 Subject: [PATCH] Unneeded conditional. --- adfs/adfs.cpp | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/adfs/adfs.cpp b/adfs/adfs.cpp index 3c0fdff..833cc63 100644 --- a/adfs/adfs.cpp +++ b/adfs/adfs.cpp @@ -335,29 +335,27 @@ pair ADFSSessionInitiator::run(SPRequest& request, const char* entity } // Since we're not passing by index, we need to fully compute the return URL. - if (!ACS) { - // Get all the ADFS endpoints. - const vector& handlers = app.getAssertionConsumerServicesByBinding(m_binding.get()); - - // Index comes from request, or default set in the handler, or we just pick the first endpoint. - pair index = make_pair(false,0); - if (isHandler) { - option = request.getParameter("acsIndex"); - if (option) - index = make_pair(true, atoi(option)); - } - if (!index.first) - index = getUnsignedInt("defaultACSIndex"); - if (index.first) { - for (vector::const_iterator h = handlers.begin(); !ACS && h!=handlers.end(); ++h) { - if (index.second == (*h)->getUnsignedInt("index").second) - ACS = *h; - } - } - else if (!handlers.empty()) { - ACS = handlers.front(); + // Get all the ADFS endpoints. + const vector& handlers = app.getAssertionConsumerServicesByBinding(m_binding.get()); + + // Index comes from request, or default set in the handler, or we just pick the first endpoint. + pair index = make_pair(false,0); + if (isHandler) { + option = request.getParameter("acsIndex"); + if (option) + index = make_pair(true, atoi(option)); + } + if (!index.first) + index = getUnsignedInt("defaultACSIndex"); + if (index.first) { + for (vector::const_iterator h = handlers.begin(); !ACS && h!=handlers.end(); ++h) { + if (index.second == (*h)->getUnsignedInt("index").second) + ACS = *h; } } + else if (!handlers.empty()) { + ACS = handlers.front(); + } if (!ACS) throw ConfigurationException("Unable to locate ADFS response endpoint."); -- 2.1.4