From: cantor Date: Sat, 19 Jun 2010 19:35:34 +0000 (+0000) Subject: Improve logging around XML processing of content. X-Git-Tag: 2.4~77 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fsp.git;a=commitdiff_plain;h=35b1befa20799c3bed9cbe996bfca2553c82cd2d Improve logging around XML processing of content. git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/branches/REL_2@3262 cb58f699-b61c-0410-a6fe-9272a202ed29 --- diff --git a/shibsp/attribute/NameIDAttributeDecoder.cpp b/shibsp/attribute/NameIDAttributeDecoder.cpp index 6b03fae..f9ff33f 100644 --- a/shibsp/attribute/NameIDAttributeDecoder.cpp +++ b/shibsp/attribute/NameIDAttributeDecoder.cpp @@ -117,23 +117,35 @@ shibsp::Attribute* NameIDAttributeDecoder::decode( for (; v!=stop; ++v) { const NameIDType* n2 = dynamic_cast(*v); - if (n2) + if (n2) { + log.debug("decoding AttributeValue element of saml2:NameIDType type"); extract(n2, dest, assertingParty, relyingParty); + } else { const NameIdentifier* n1=dynamic_cast(*v); - if (n1) + if (n1) { + log.debug("decoding AttributeValue element of saml1:NameIdentifier type"); extract(n1, dest, assertingParty, relyingParty); + } else if ((*v)->hasChildren()) { const list& values = (*v)->getOrderedChildren(); for (list::const_iterator vv = values.begin(); vv!=values.end(); ++vv) { - if (n2=dynamic_cast(*vv)) + if (n2=dynamic_cast(*vv)) { + log.debug("decoding saml2:NameID child element of AttributeValue"); extract(n2, dest, assertingParty, relyingParty); - else if (n1=dynamic_cast(*vv)) + } + else if (n1=dynamic_cast(*vv)) { + log.debug("decoding saml1:NameIdentifier child element of AttributeValue"); extract(n1, dest, assertingParty, relyingParty); - else - log.warn("skipping AttributeValue without a recognizable NameID/NameIdentifier"); + } + else { + log.warn("skipping AttributeValue child element not recognizable as NameID/NameIdentifier"); + } } } + else { + log.warn("AttributeValue was not of a supported type and contains no child elements"); + } } }