From: Scott Cantor Date: Wed, 4 Feb 2009 04:15:53 +0000 (+0000) Subject: Rework support for libcurl-based input to parser. X-Git-Tag: 2.2.0~113 X-Git-Url: http://www.project-moonshot.org/gitweb/?a=commitdiff_plain;h=80286c50d9d9e84a6c9e0ad53185e01d187bfa9c;p=shibboleth%2Fcpp-sp.git Rework support for libcurl-based input to parser. --- diff --git a/shibsp/SPConfig.cpp b/shibsp/SPConfig.cpp index 7aaaf98..7d44387 100644 --- a/shibsp/SPConfig.cpp +++ b/shibsp/SPConfig.cpp @@ -1,6 +1,6 @@ /* - * Copyright 2001-2007 Internet2 + * Copyright 2001-2009 Internet2 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,7 +55,6 @@ # include "metadata/MetadataExt.h" # include "security/PKIXTrustEngine.h" # include -# include #else # include #endif @@ -140,7 +139,6 @@ bool SPConfig::init(const char* catalog_path, const char* inst_prefix) log.fatal("failed to initialize OpenSAML library"); return false; } - XMLPlatformUtils::fgNetAccessor = new CurlNetAccessor(); #else if (!XMLToolingConfig::getConfig().init()) { log.fatal("failed to initialize XMLTooling library"); @@ -220,6 +218,9 @@ void SPConfig::term() log.info("%s library shutting down", PACKAGE_STRING); setServiceProvider(NULL); + if (m_configDoc) + m_configDoc->release(); + m_configDoc = NULL; #ifndef SHIBSP_LITE setArtifactResolver(NULL); #endif @@ -289,6 +290,9 @@ bool SPConfig::instantiate(const char* config, bool rethrow) dummydoc = XMLToolingConfig::getConfig().getParser().parse(snippet); XercesJanitor docjanitor(dummydoc); setServiceProvider(ServiceProviderManager.newPlugin(XML_SERVICE_PROVIDER, dummydoc->getDocumentElement())); + if (m_configDoc) + m_configDoc->release(); + m_configDoc = docjanitor.release(); } else { stringstream snippet(config); @@ -300,6 +304,9 @@ bool SPConfig::instantiate(const char* config, bool rethrow) setServiceProvider(ServiceProviderManager.newPlugin(type.get(), dummydoc->getDocumentElement())); else throw ConfigurationException("The supplied XML bootstrapping configuration did not include a type attribute."); + if (m_configDoc) + m_configDoc->release(); + m_configDoc = docjanitor.release(); } getServiceProvider()->init(); diff --git a/shibsp/SPConfig.h b/shibsp/SPConfig.h index fd8454c..99f1a22 100644 --- a/shibsp/SPConfig.h +++ b/shibsp/SPConfig.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Internet2 + * Copyright 2001-2009 Internet2 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -69,7 +69,8 @@ namespace shibsp { #ifndef SHIBSP_LITE m_artifactResolver(NULL), #endif - m_features(0) {} + m_features(0), m_configDoc(NULL) { + } virtual ~SPConfig() {} @@ -291,6 +292,7 @@ namespace shibsp { private: unsigned long m_features; + xercesc::DOMDocument* m_configDoc; }; #if defined (_MSC_VER)