From: Scott Cantor Date: Thu, 28 Jun 2007 23:41:25 +0000 (+0000) Subject: Expose detection of duplicate insertions. X-Git-Tag: 2.0-alpha2~7 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-opensaml.git;a=commitdiff_plain;h=8e90e18426cf9465a2127aa4661a598c8ab98281 Expose detection of duplicate insertions. --- diff --git a/saml/binding/impl/ArtifactMap.cpp b/saml/binding/impl/ArtifactMap.cpp index c22c6ef..2028ac0 100644 --- a/saml/binding/impl/ArtifactMap.cpp +++ b/saml/binding/impl/ArtifactMap.cpp @@ -204,9 +204,14 @@ void ArtifactMap::storeContent(XMLObject* content, const SAMLArtifact* artifact, // Serialize the root element, whatever it is, for storage. string xmlbuf; XMLHelper::serialize(root, xmlbuf); - m_storage->createText( - m_context.c_str(), SAMLArtifact::toHex(artifact->getMessageHandle()).c_str(), xmlbuf.c_str(), time(NULL) + m_artifactTTL - ); + if (!m_storage->createText( + m_context.c_str(), + SAMLArtifact::toHex(artifact->getMessageHandle()).c_str(), + xmlbuf.c_str(), + time(NULL) + m_artifactTTL + )) { + throw IOException("Attempt to insert duplicate artifact into map."); + } // Cleanup by destroying XML. delete content;