From: Scott Cantor Date: Mon, 29 Dec 2008 21:05:05 +0000 (+0000) Subject: Xerces 3 revisions. X-Git-Tag: 2.2.0~128 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-sp.git;a=commitdiff_plain;h=7a5cf4f75466e17263018c7b220e7f020774ba1b Xerces 3 revisions. --- diff --git a/config_win32.h b/config_win32.h index 431f378..80f49d9 100644 --- a/config_win32.h +++ b/config_win32.h @@ -40,6 +40,13 @@ /* Define if Xerces-C library was found */ #define HAVE_LIBXERCESC 1 +#include + +#if (XERCES_VERSION_MAJOR < 3) +# define SHIBSP_XERCESC_HAS_XMLBYTE_RELEASE 1 +# define SHIBSP_XERCESC_SHORT_ACCEPTNODE 1 +#endif + /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 diff --git a/configure.ac b/configure.ac index b3e9cff..6a8ef69 100644 --- a/configure.ac +++ b/configure.ac @@ -222,6 +222,30 @@ AC_TRY_LINK( [AC_DEFINE(HAVE_LIBXERCESC,1,[Define if Xerces-C library was found])], [AC_MSG_ERROR([unable to link with Xerces])]) +AC_MSG_CHECKING([whether Xerces XMLString::release(XMLByte**) exists]) +AC_TRY_COMPILE([#include ], + [using namespace XERCES_CPP_NAMESPACE; + XMLByte* buf=NULL; + XMLString::release(&buf); + ], + [AC_MSG_RESULT([yes])] + [AC_DEFINE([SHIBSP_XERCESC_HAS_XMLBYTE_RELEASE], [1], [Define to 1 if Xerces XMLString includes XMLByte release.])], + [AC_MSG_RESULT([no])]) + +AC_MSG_CHECKING([whether Xerces DOMNodeFilter API returns a short]) +AC_TRY_COMPILE([#include ], + [using namespace XERCES_CPP_NAMESPACE; + class Blocker : public DOMNodeFilter { + public: + short acceptNode(const DOMNode* node) const { + return FILTER_REJECT; + } + }; + static Blocker g_Blocker; + ], + [AC_MSG_RESULT([yes])] + [AC_DEFINE([SHIBSP_XERCESC_SHORT_ACCEPTNODE], [1], [Define to 1 if Xerces DOMNodeFilter API returns a short.])], + [AC_MSG_RESULT([no])]) #XML-Tooling settings AC_ARG_WITH(xmltooling, diff --git a/shibsp/attribute/Attribute.cpp b/shibsp/attribute/Attribute.cpp index d4301e4..7792677 100644 --- a/shibsp/attribute/Attribute.cpp +++ b/shibsp/attribute/Attribute.cpp @@ -51,10 +51,10 @@ namespace shibsp { } #ifndef SHIBSP_LITE - SHIBSP_DLLLOCAL PluginManager::Factory StringAttributeDecoderFactory; - SHIBSP_DLLLOCAL PluginManager::Factory ScopedAttributeDecoderFactory; - SHIBSP_DLLLOCAL PluginManager::Factory NameIDAttributeDecoderFactory; - SHIBSP_DLLLOCAL PluginManager::Factory NameIDFromScopedAttributeDecoderFactory; + SHIBSP_DLLLOCAL PluginManager::Factory StringAttributeDecoderFactory; + SHIBSP_DLLLOCAL PluginManager::Factory ScopedAttributeDecoderFactory; + SHIBSP_DLLLOCAL PluginManager::Factory NameIDAttributeDecoderFactory; + SHIBSP_DLLLOCAL PluginManager::Factory NameIDFromScopedAttributeDecoderFactory; static const XMLCh _StringAttributeDecoder[] = UNICODE_LITERAL_22(S,t,r,i,n,g,A,t,t,r,i,b,u,t,e,D,e,c,o,d,e,r); static const XMLCh _ScopedAttributeDecoder[] = UNICODE_LITERAL_22(S,c,o,p,e,d,A,t,t,r,i,b,u,t,e,D,e,c,o,d,e,r); @@ -66,10 +66,10 @@ namespace shibsp { }; #ifndef SHIBSP_LITE -QName shibsp::StringAttributeDecoderType(shibspconstants::SHIB2ATTRIBUTEMAP_NS, _StringAttributeDecoder); -QName shibsp::ScopedAttributeDecoderType(shibspconstants::SHIB2ATTRIBUTEMAP_NS, _ScopedAttributeDecoder); -QName shibsp::NameIDAttributeDecoderType(shibspconstants::SHIB2ATTRIBUTEMAP_NS, _NameIDAttributeDecoder); -QName shibsp::NameIDFromScopedAttributeDecoderType(shibspconstants::SHIB2ATTRIBUTEMAP_NS, _NameIDFromScopedAttributeDecoder); +xmltooling::QName shibsp::StringAttributeDecoderType(shibspconstants::SHIB2ATTRIBUTEMAP_NS, _StringAttributeDecoder); +xmltooling::QName shibsp::ScopedAttributeDecoderType(shibspconstants::SHIB2ATTRIBUTEMAP_NS, _ScopedAttributeDecoder); +xmltooling::QName shibsp::NameIDAttributeDecoderType(shibspconstants::SHIB2ATTRIBUTEMAP_NS, _NameIDAttributeDecoder); +xmltooling::QName shibsp::NameIDFromScopedAttributeDecoderType(shibspconstants::SHIB2ATTRIBUTEMAP_NS, _NameIDFromScopedAttributeDecoder); void shibsp::registerAttributeDecoders() { diff --git a/shibsp/attribute/NameIDFromScopedAttributeDecoder.cpp b/shibsp/attribute/NameIDFromScopedAttributeDecoder.cpp index 7e807b9..5711419 100644 --- a/shibsp/attribute/NameIDFromScopedAttributeDecoder.cpp +++ b/shibsp/attribute/NameIDFromScopedAttributeDecoder.cpp @@ -75,7 +75,7 @@ shibsp::Attribute* NameIDFromScopedAttributeDecoder::decode( char* val; char* scope; const XMLCh* xmlscope; - QName scopeqname(NULL,Scope); + xmltooling::QName scopeqname(NULL,Scope); auto_ptr nameid( new NameIDAttribute(ids, (m_formatter.get() && *m_formatter.get()) ? m_formatter.get() : DEFAULT_NAMEID_FORMATTER) ); diff --git a/shibsp/attribute/ScopedAttributeDecoder.cpp b/shibsp/attribute/ScopedAttributeDecoder.cpp index 2044d6b..da112b0 100644 --- a/shibsp/attribute/ScopedAttributeDecoder.cpp +++ b/shibsp/attribute/ScopedAttributeDecoder.cpp @@ -69,7 +69,7 @@ shibsp::Attribute* ScopedAttributeDecoder::decode( char* val; char* scope; const XMLCh* xmlscope; - QName scopeqname(NULL,Scope); + xmltooling::QName scopeqname(NULL,Scope); auto_ptr scoped(new ScopedAttribute(ids, m_delimeter)); scoped->setCaseSensitive(m_caseSensitive); vector< pair >& dest = scoped->getValues(); diff --git a/shibsp/attribute/filtering/impl/AndMatchFunctor.cpp b/shibsp/attribute/filtering/impl/AndMatchFunctor.cpp index 857050d..35cea2c 100644 --- a/shibsp/attribute/filtering/impl/AndMatchFunctor.cpp +++ b/shibsp/attribute/filtering/impl/AndMatchFunctor.cpp @@ -109,7 +109,7 @@ MatchFunctor* AndMatchFunctor::buildFunctor(const DOMElement* e, const FilterPol if (*id && functorMap->getMatchFunctors().count(id)) id = ""; - auto_ptr type(XMLHelper::getXSIType(e)); + auto_ptr type(XMLHelper::getXSIType(e)); if (!type.get()) throw ConfigurationException("Child Rule found with no xsi:type."); diff --git a/shibsp/attribute/filtering/impl/MatchFunctor.cpp b/shibsp/attribute/filtering/impl/MatchFunctor.cpp index 06fd7b2..1ba0ec6 100644 --- a/shibsp/attribute/filtering/impl/MatchFunctor.cpp +++ b/shibsp/attribute/filtering/impl/MatchFunctor.cpp @@ -31,13 +31,13 @@ using namespace xmltooling; using namespace std; #define DECL_FACTORY(name) \ - SHIBSP_DLLLOCAL PluginManager< MatchFunctor,QName,pair >::Factory name##Factory + SHIBSP_DLLLOCAL PluginManager< MatchFunctor,xmltooling::QName,pair >::Factory name##Factory #define DECL_BASIC_QNAME(name,lit) \ - QName shibsp::name##Type(shibspconstants::SHIB2ATTRIBUTEFILTER_MF_BASIC_NS, lit) + xmltooling::QName shibsp::name##Type(shibspconstants::SHIB2ATTRIBUTEFILTER_MF_BASIC_NS, lit) #define DECL_SAML_QNAME(name,lit) \ - QName shibsp::name##Type(shibspconstants::SHIB2ATTRIBUTEFILTER_MF_SAML_NS, lit) + xmltooling::QName shibsp::name##Type(shibspconstants::SHIB2ATTRIBUTEFILTER_MF_SAML_NS, lit) #define REGISTER_FACTORY(name) \ mgr.registerFactory(name##Type, name##Factory) @@ -104,7 +104,7 @@ DECL_SAML_QNAME(AttributeScopeMatchesShibMDScope, AttributeScopeMatchesShibMDSco void SHIBSP_API shibsp::registerMatchFunctors() { - PluginManager< MatchFunctor,QName,pair >& mgr = + PluginManager< MatchFunctor,xmltooling::QName,pair >& mgr = SPConfig::getConfig().MatchFunctorManager; REGISTER_FACTORY(AnyMatchFunctor); REGISTER_FACTORY(AndMatchFunctor); diff --git a/shibsp/attribute/filtering/impl/NotMatchFunctor.cpp b/shibsp/attribute/filtering/impl/NotMatchFunctor.cpp index 0f79a84..9a22474 100644 --- a/shibsp/attribute/filtering/impl/NotMatchFunctor.cpp +++ b/shibsp/attribute/filtering/impl/NotMatchFunctor.cpp @@ -99,7 +99,7 @@ MatchFunctor* NotMatchFunctor::buildFunctor(const DOMElement* e, const FilterPol if (*id && functorMap->getMatchFunctors().count(id)) id = ""; - auto_ptr type(XMLHelper::getXSIType(e)); + auto_ptr type(XMLHelper::getXSIType(e)); if (!type.get()) throw ConfigurationException("Child Rule found with no xsi:type."); diff --git a/shibsp/attribute/filtering/impl/OrMatchFunctor.cpp b/shibsp/attribute/filtering/impl/OrMatchFunctor.cpp index cd29548..2649f42 100644 --- a/shibsp/attribute/filtering/impl/OrMatchFunctor.cpp +++ b/shibsp/attribute/filtering/impl/OrMatchFunctor.cpp @@ -105,7 +105,7 @@ MatchFunctor* OrMatchFunctor::buildFunctor(const DOMElement* e, const FilterPoli if (*id && functorMap->getMatchFunctors().count(id)) id = ""; - auto_ptr type(XMLHelper::getXSIType(e)); + auto_ptr type(XMLHelper::getXSIType(e)); if (!type.get()) throw ConfigurationException("Child Rule found with no xsi:type."); diff --git a/shibsp/attribute/filtering/impl/XMLAttributeFilter.cpp b/shibsp/attribute/filtering/impl/XMLAttributeFilter.cpp index 801ea57..afd10e1 100644 --- a/shibsp/attribute/filtering/impl/XMLAttributeFilter.cpp +++ b/shibsp/attribute/filtering/impl/XMLAttributeFilter.cpp @@ -228,7 +228,7 @@ MatchFunctor* XMLFilterImpl::buildFunctor( id = ""; } - auto_ptr type(XMLHelper::getXSIType(e)); + auto_ptr type(XMLHelper::getXSIType(e)); if (type.get()) { try { MatchFunctor* func = SPConfig::getConfig().MatchFunctorManager.newPlugin(*type.get(), make_pair(&functorMap,e)); diff --git a/shibsp/attribute/resolver/impl/XMLAttributeExtractor.cpp b/shibsp/attribute/resolver/impl/XMLAttributeExtractor.cpp index eeead9f..8f10d20 100644 --- a/shibsp/attribute/resolver/impl/XMLAttributeExtractor.cpp +++ b/shibsp/attribute/resolver/impl/XMLAttributeExtractor.cpp @@ -176,7 +176,7 @@ XMLExtractorImpl::XMLExtractorImpl(const DOMElement* e, Category& log) : m_log(l try { DOMElement* dchild = XMLHelper::getFirstChildElement(child, shibspconstants::SHIB2ATTRIBUTEMAP_NS, _AttributeDecoder); if (dchild) { - auto_ptr q(XMLHelper::getXSIType(dchild)); + auto_ptr q(XMLHelper::getXSIType(dchild)); if (q.get()) decoder = SPConfig::getConfig().AttributeDecoderManager.newPlugin(*q.get(), dchild); } diff --git a/shibsp/binding/impl/ArtifactResolver.cpp b/shibsp/binding/impl/ArtifactResolver.cpp index 332549f..52e68fc 100644 --- a/shibsp/binding/impl/ArtifactResolver.cpp +++ b/shibsp/binding/impl/ArtifactResolver.cpp @@ -87,7 +87,7 @@ saml1p::Response* ArtifactResolver::resolve( throw MetadataException("No compatible endpoint found in issuer's metadata."); else if (!response) throw BindingException("Unable to resolve artifact(s) into a SAML response."); - const QName* code = (response->getStatus() && response->getStatus()->getStatusCode()) ? response->getStatus()->getStatusCode()->getValue() : NULL; + const xmltooling::QName* code = (response->getStatus() && response->getStatus()->getStatusCode()) ? response->getStatus()->getStatusCode()->getValue() : NULL; if (!code || *code != saml1p::StatusCode::SUCCESS) { delete response; throw BindingException("Identity provider returned a SAML error in response to artifact(s)."); diff --git a/shibsp/handler/impl/AbstractHandler.cpp b/shibsp/handler/impl/AbstractHandler.cpp index 3f298df..3b3c0dc 100644 --- a/shibsp/handler/impl/AbstractHandler.cpp +++ b/shibsp/handler/impl/AbstractHandler.cpp @@ -145,7 +145,7 @@ void AbstractHandler::checkError(const XMLObject* response, const saml2md::RoleD const saml1p::Status* status = r1->getStatus(); if (status) { const saml1p::StatusCode* sc = status->getStatusCode(); - const QName* code = sc ? sc->getValue() : NULL; + const xmltooling::QName* code = sc ? sc->getValue() : NULL; if (code && *code != saml1p::StatusCode::SUCCESS) { FatalProfileException ex("SAML response contained an error."); ex.addProperty("statusCode", code->toString().c_str()); diff --git a/shibsp/handler/impl/AssertionLookup.cpp b/shibsp/handler/impl/AssertionLookup.cpp index 7c795db..adeb711 100644 --- a/shibsp/handler/impl/AssertionLookup.cpp +++ b/shibsp/handler/impl/AssertionLookup.cpp @@ -45,7 +45,12 @@ namespace shibsp { class SHIBSP_DLLLOCAL Blocker : public DOMNodeFilter { public: - short acceptNode(const DOMNode* node) const { +#ifdef SHIBSP_XERCESC_SHORT_ACCEPTNODE + short +#else + FilterAction +#endif + acceptNode(const DOMNode* node) const { return FILTER_REJECT; } }; diff --git a/shibsp/handler/impl/ChainingLogoutInitiator.cpp b/shibsp/handler/impl/ChainingLogoutInitiator.cpp index e8de4d6..4fc6776 100644 --- a/shibsp/handler/impl/ChainingLogoutInitiator.cpp +++ b/shibsp/handler/impl/ChainingLogoutInitiator.cpp @@ -75,7 +75,12 @@ namespace shibsp { class SHIBSP_DLLLOCAL LogoutInitiatorNodeFilter : public DOMNodeFilter { public: - short acceptNode(const DOMNode* node) const { +#ifdef SHIBSP_XERCESC_SHORT_ACCEPTNODE + short +#else + FilterAction +#endif + acceptNode(const DOMNode* node) const { if (XMLHelper::isNodeNamed(node,shibspconstants::SHIB2SPCONFIG_NS,_LogoutInitiator)) return FILTER_REJECT; return FILTER_ACCEPT; diff --git a/shibsp/handler/impl/ChainingSessionInitiator.cpp b/shibsp/handler/impl/ChainingSessionInitiator.cpp index dcd29d6..1cbc45b 100644 --- a/shibsp/handler/impl/ChainingSessionInitiator.cpp +++ b/shibsp/handler/impl/ChainingSessionInitiator.cpp @@ -71,7 +71,12 @@ namespace shibsp { class SHIBSP_DLLLOCAL SessionInitiatorNodeFilter : public DOMNodeFilter { public: - short acceptNode(const DOMNode* node) const { +#ifdef SHIBSP_XERCESC_SHORT_ACCEPTNODE + short +#else + FilterAction +#endif + acceptNode(const DOMNode* node) const { if (XMLHelper::isNodeNamed(node,shibspconstants::SHIB2SPCONFIG_NS,_SessionInitiator)) return FILTER_REJECT; return FILTER_ACCEPT; diff --git a/shibsp/handler/impl/LogoutHandler.cpp b/shibsp/handler/impl/LogoutHandler.cpp index f124283..0315928 100644 --- a/shibsp/handler/impl/LogoutHandler.cpp +++ b/shibsp/handler/impl/LogoutHandler.cpp @@ -216,7 +216,7 @@ bool LogoutHandler::notifyBackChannel( env->setBody(body); ElementProxy* msg = new AnyElementImpl(shibspconstants::SHIB2SPNOTIFY_NS, LogoutNotification); body->getUnknownXMLObjects().push_back(msg); - msg->setAttribute(QName(NULL, _type), local ? _local : _global); + msg->setAttribute(xmltooling::QName(NULL, _type), local ? _local : _global); for (vector::const_iterator s = sessions.begin(); s!=sessions.end(); ++s) { auto_ptr_XMLCh temp(s->c_str()); ElementProxy* child = new AnyElementImpl(shibspconstants::SHIB2SPNOTIFY_NS, SessionID); diff --git a/shibsp/handler/impl/MetadataGenerator.cpp b/shibsp/handler/impl/MetadataGenerator.cpp index 94f8485..2a847cb 100644 --- a/shibsp/handler/impl/MetadataGenerator.cpp +++ b/shibsp/handler/impl/MetadataGenerator.cpp @@ -54,7 +54,12 @@ namespace shibsp { class SHIBSP_DLLLOCAL Blocker : public DOMNodeFilter { public: - short acceptNode(const DOMNode* node) const { +#ifdef SHIBSP_XERCESC_SHORT_ACCEPTNODE + short +#else + FilterAction +#endif + acceptNode(const DOMNode* node) const { return FILTER_REJECT; } }; diff --git a/shibsp/handler/impl/SAML2ArtifactResolution.cpp b/shibsp/handler/impl/SAML2ArtifactResolution.cpp index ef85778..6b98392 100644 --- a/shibsp/handler/impl/SAML2ArtifactResolution.cpp +++ b/shibsp/handler/impl/SAML2ArtifactResolution.cpp @@ -90,7 +90,7 @@ namespace shibsp { MessageEncoder* m_encoder; MessageDecoder* m_decoder; - QName m_role; + xmltooling::QName m_role; #endif }; @@ -121,7 +121,7 @@ SAML2ArtifactResolution::SAML2ArtifactResolution(const DOMElement* e, const char getString("Binding").second,pair(e,NULL) ); } - catch (exception& ex) { + catch (exception&) { m_log.error("error building MessageEncoder/Decoder pair for binding (%s)", getString("Binding").second); delete m_encoder; delete m_decoder; diff --git a/shibsp/handler/impl/SAML2Logout.cpp b/shibsp/handler/impl/SAML2Logout.cpp index d917407..f7f5c0b 100644 --- a/shibsp/handler/impl/SAML2Logout.cpp +++ b/shibsp/handler/impl/SAML2Logout.cpp @@ -109,7 +109,7 @@ namespace shibsp { bool front ) const; - QName m_role; + xmltooling::QName m_role; MessageDecoder* m_decoder; XMLCh* m_outgoing; vector m_bindings; diff --git a/shibsp/handler/impl/SAML2NameIDMgmt.cpp b/shibsp/handler/impl/SAML2NameIDMgmt.cpp index 5ac6110..56b38eb 100644 --- a/shibsp/handler/impl/SAML2NameIDMgmt.cpp +++ b/shibsp/handler/impl/SAML2NameIDMgmt.cpp @@ -110,7 +110,7 @@ namespace shibsp { bool front ) const; - QName m_role; + xmltooling::QName m_role; MessageDecoder* m_decoder; XMLCh* m_outgoing; vector m_bindings; diff --git a/shibsp/handler/impl/SAMLDSSessionInitiator.cpp b/shibsp/handler/impl/SAMLDSSessionInitiator.cpp index 6a7cbd1..9545420 100644 --- a/shibsp/handler/impl/SAMLDSSessionInitiator.cpp +++ b/shibsp/handler/impl/SAMLDSSessionInitiator.cpp @@ -78,10 +78,10 @@ namespace shibsp { hurl += loc; auto_ptr_XMLCh widen(hurl.c_str()); ElementProxy* ep = new AnyElementImpl(m_discoNS.get(), LOCAL_NAME); - ep->setAttribute(QName(NULL,EndpointType::LOCATION_ATTRIB_NAME), widen.get()); - ep->setAttribute(QName(NULL,EndpointType::BINDING_ATTRIB_NAME), m_discoNS.get()); + ep->setAttribute(xmltooling::QName(NULL,EndpointType::LOCATION_ATTRIB_NAME), widen.get()); + ep->setAttribute(xmltooling::QName(NULL,EndpointType::BINDING_ATTRIB_NAME), m_discoNS.get()); pair ix = getXMLString("index"); - ep->setAttribute(QName(NULL,IndexedEndpointType::INDEX_ATTRIB_NAME), ix.first ? ix.second : xmlconstants::XML_ONE); + ep->setAttribute(xmltooling::QName(NULL,IndexedEndpointType::INDEX_ATTRIB_NAME), ix.first ? ix.second : xmlconstants::XML_ONE); Extensions* ext = role.getExtensions(); if (!ext) { diff --git a/shibsp/handler/impl/SessionHandler.cpp b/shibsp/handler/impl/SessionHandler.cpp index 5b60f52..813aad9 100644 --- a/shibsp/handler/impl/SessionHandler.cpp +++ b/shibsp/handler/impl/SessionHandler.cpp @@ -45,7 +45,12 @@ namespace shibsp { class SHIBSP_DLLLOCAL Blocker : public DOMNodeFilter { public: - short acceptNode(const DOMNode* node) const { +#ifdef SHIBSP_XERCESC_SHORT_ACCEPTNODE + short +#else + FilterAction +#endif + acceptNode(const DOMNode* node) const { return FILTER_REJECT; } }; diff --git a/shibsp/handler/impl/StatusHandler.cpp b/shibsp/handler/impl/StatusHandler.cpp index f35b8c5..5886a91 100644 --- a/shibsp/handler/impl/StatusHandler.cpp +++ b/shibsp/handler/impl/StatusHandler.cpp @@ -50,7 +50,12 @@ namespace shibsp { class SHIBSP_DLLLOCAL Blocker : public DOMNodeFilter { public: - short acceptNode(const DOMNode* node) const { +#ifdef SHIBSP_XERCESC_SHORT_ACCEPTNODE + short +#else + FilterAction +#endif + acceptNode(const DOMNode* node) const { return FILTER_REJECT; } }; diff --git a/shibsp/handler/impl/TransformSessionInitiator.cpp b/shibsp/handler/impl/TransformSessionInitiator.cpp index 36759f3..390d3d8 100644 --- a/shibsp/handler/impl/TransformSessionInitiator.cpp +++ b/shibsp/handler/impl/TransformSessionInitiator.cpp @@ -55,7 +55,12 @@ namespace shibsp { class SHIBSP_DLLLOCAL TransformSINodeFilter : public DOMNodeFilter { public: - short acceptNode(const DOMNode* node) const { +#ifdef SHIBSP_XERCESC_SHORT_ACCEPTNODE + short +#else + FilterAction +#endif + acceptNode(const DOMNode* node) const { return FILTER_REJECT; } }; diff --git a/shibsp/impl/XMLRequestMapper.cpp b/shibsp/impl/XMLRequestMapper.cpp index 9c5f294..7868887 100644 --- a/shibsp/impl/XMLRequestMapper.cpp +++ b/shibsp/impl/XMLRequestMapper.cpp @@ -62,7 +62,12 @@ namespace shibsp { ~Override(); // Provides filter to exclude special config elements. - short acceptNode(const DOMNode* node) const { +#ifdef SHIBSP_XERCESC_SHORT_ACCEPTNODE + short +#else + FilterAction +#endif + acceptNode(const DOMNode* node) const { return FILTER_REJECT; } diff --git a/shibsp/impl/XMLServiceProvider.cpp b/shibsp/impl/XMLServiceProvider.cpp index f9954d1..542ff4c 100644 --- a/shibsp/impl/XMLServiceProvider.cpp +++ b/shibsp/impl/XMLServiceProvider.cpp @@ -168,7 +168,12 @@ namespace { } // Provides filter to exclude special config elements. - short acceptNode(const DOMNode* node) const; +#ifdef SHIBSP_XERCESC_SHORT_ACCEPTNODE + short +#else + FilterAction +#endif + acceptNode(const DOMNode* node) const; private: void cleanup(); @@ -244,7 +249,12 @@ namespace { #endif // Provides filter to exclude special config elements. - short acceptNode(const DOMNode* node) const; +#ifdef SHIBSP_XERCESC_SHORT_ACCEPTNODE + short +#else + FilterAction +#endif + acceptNode(const DOMNode* node) const; void setDocument(DOMDocument* doc) { m_document = doc; @@ -440,7 +450,12 @@ namespace { class SHIBSP_DLLLOCAL PolicyNodeFilter : public DOMNodeFilter { public: - short acceptNode(const DOMNode* node) const { +#ifdef SHIBSP_XERCESC_SHORT_ACCEPTNODE + short +#else + FilterAction +#endif + acceptNode(const DOMNode* node) const { return FILTER_REJECT; } }; @@ -945,7 +960,12 @@ void XMLApplication::cleanup() #endif } -short XMLApplication::acceptNode(const DOMNode* node) const +#ifdef SHIBSP_XERCESC_SHORT_ACCEPTNODE +short +#else +DOMNodeFilter::FilterAction +#endif +XMLApplication::acceptNode(const DOMNode* node) const { const XMLCh* name=node->getLocalName(); if (XMLString::equals(name,ApplicationOverride) || @@ -1201,7 +1221,12 @@ void XMLApplication::getHandlers(vector& handlers) const } } -short XMLConfigImpl::acceptNode(const DOMNode* node) const +#ifdef SHIBSP_XERCESC_SHORT_ACCEPTNODE +short +#else +DOMNodeFilter::FilterAction +#endif +XMLConfigImpl::acceptNode(const DOMNode* node) const { if (!XMLString::equals(node->getNamespaceURI(),shibspconstants::SHIB2SPCONFIG_NS)) return FILTER_ACCEPT; diff --git a/shibsp/lite/CommonDomainCookie.cpp b/shibsp/lite/CommonDomainCookie.cpp index fd3bfba..cb8ffc0 100644 --- a/shibsp/lite/CommonDomainCookie.cpp +++ b/shibsp/lite/CommonDomainCookie.cpp @@ -1,6 +1,6 @@ /* * Copyright 2001-2007 Internet2 - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -16,8 +16,8 @@ /** * CommonDomainCookie.cpp - * - * Helper class for maintaining discovery cookie. + * + * Helper class for maintaining discovery cookie. */ #include "internal.h" @@ -55,12 +55,16 @@ CommonDomainCookie::CommonDomainCookie(const char* cookie) free(b64); // Now Base64 decode the list. - unsigned int len; + xsecsize_t len; for (vector::iterator i=templist.begin(); i!=templist.end(); ++i) { XMLByte* decoded=Base64::decode(reinterpret_cast(i->c_str()),&len); if (decoded && *decoded) { m_list.push_back(reinterpret_cast(decoded)); +#ifdef SHIBSP_XERCESC_HAS_XMLBYTE_RELEASE XMLString::release(&decoded); +#else + XMLString::release((char**)&decoded); +#endif } } } @@ -74,27 +78,31 @@ const char* CommonDomainCookie::set(const char* entityID) break; } } - + // Append it to the end. m_list.push_back(entityID); - + // Now rebuild the delimited list. - unsigned int len; + xsecsize_t len; string delimited; for (vector::const_iterator j=m_list.begin(); j!=m_list.end(); j++) { if (!delimited.empty()) delimited += ' '; - + XMLByte* b64=Base64::encode(reinterpret_cast(j->c_str()),j->length(),&len); XMLByte *pos, *pos2; for (pos=b64, pos2=b64; *pos2; pos2++) if (isgraph(*pos2)) *pos++=*pos2; *pos=0; - + delimited += reinterpret_cast(b64); +#ifdef SHIBSP_XERCESC_HAS_XMLBYTE_RELEASE XMLString::release(&b64); +#else + XMLString::release((char**)&b64); +#endif } - + m_encoded=XMLToolingConfig::getConfig().getURLEncoder()->encode(delimited.c_str()); return m_encoded.c_str(); } diff --git a/shibsp/metadata/MetadataExtImpl.cpp b/shibsp/metadata/MetadataExtImpl.cpp index 6188b46..71fb17a 100644 --- a/shibsp/metadata/MetadataExtImpl.cpp +++ b/shibsp/metadata/MetadataExtImpl.cpp @@ -59,7 +59,7 @@ namespace shibsp { public: - ScopeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) + ScopeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) : AbstractXMLObject(nsURI, localName, prefix, schemaType) { init(); } @@ -99,7 +99,7 @@ namespace shibsp { XMLString::release(&m_VerifyDepth); } - KeyAuthorityImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) + KeyAuthorityImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) : AbstractXMLObject(nsURI, localName, prefix, schemaType) { init(); } @@ -119,7 +119,7 @@ namespace shibsp { IMPL_TYPED_CHILDREN(KeyInfo,m_children.end()); public: - void setAttribute(const QName& qualifiedName, const XMLCh* value, bool ID=false) { + void setAttribute(const xmltooling::QName& qualifiedName, const XMLCh* value, bool ID=false) { if (!qualifiedName.hasNamespaceURI()) { if (XMLString::equals(qualifiedName.getLocalPart(),VERIFYDEPTH_ATTRIB_NAME)) { setVerifyDepth(value); diff --git a/shibsp/metadata/MetadataExtSchemaValidators.cpp b/shibsp/metadata/MetadataExtSchemaValidators.cpp index d175ba4..f9b4472 100644 --- a/shibsp/metadata/MetadataExtSchemaValidators.cpp +++ b/shibsp/metadata/MetadataExtSchemaValidators.cpp @@ -46,12 +46,12 @@ namespace shibsp { }; #define REGISTER_ELEMENT(cname) \ - q=QName(SHIBMD_NS,cname::LOCAL_NAME); \ + q=xmltooling::QName(SHIBMD_NS,cname::LOCAL_NAME); \ XMLObjectBuilder::registerBuilder(q,new cname##Builder()); \ SchemaValidators.registerValidator(q,new cname##SchemaValidator()) void shibsp::registerMetadataExtClasses() { - QName q; + xmltooling::QName q; REGISTER_ELEMENT(Scope); REGISTER_ELEMENT(KeyAuthority);