X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=shibsp%2Flite%2FCommonDomainCookie.cpp;h=cb8ffc08115f9c28f48b21688004bd43c8bf5de5;hb=a5b1914f888d2ac8992cc4985d65e9d727aa8df4;hp=fd3bfba90b440167115f243e006aa2ed78108b37;hpb=8cfb88bff921f1830d05045bf266b88f8d49abd7;p=shibboleth%2Fsp.git 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(); }