2 * Copyright 2001-2007 Internet2
\r
4 * Licensed under the Apache License, Version 2.0 (the "License");
\r
5 * you may not use this file except in compliance with the License.
\r
6 * You may obtain a copy of the License at
\r
8 * http://www.apache.org/licenses/LICENSE-2.0
\r
10 * Unless required by applicable law or agreed to in writing, software
\r
11 * distributed under the License is distributed on an "AS IS" BASIS,
\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 * See the License for the specific language governing permissions and
\r
14 * limitations under the License.
\r
18 * StorageServiceSessionCache.cpp
\r
20 * StorageService-based SessionCache implementation.
\r
22 * Instead of optimizing this plugin with a buffering scheme that keeps objects around
\r
23 * and avoids extra parsing steps, I'm assuming that systems that require such can
\r
24 * layer their own cache plugin on top of this version either by delegating to it
\r
25 * or using the remoting support. So this version will load sessions directly
\r
26 * from the StorageService, instantiate enough to expose the Session API,
\r
27 * and then delete everything when they're unlocked. All data in memory is always
\r
28 * kept in sync with the StorageService (no lazy updates).
\r
31 #include "internal.h"
\r
32 #include "Application.h"
\r
33 #include "exceptions.h"
\r
34 #include "ServiceProvider.h"
\r
35 #include "SessionCache.h"
\r
36 #include "TransactionLog.h"
\r
37 #include "attribute/Attribute.h"
\r
38 #include "remoting/ListenerService.h"
\r
39 #include "util/SPConstants.h"
\r
41 #include <log4cpp/Category.hh>
\r
42 #include <saml/SAMLConfig.h>
\r
43 #include <xmltooling/util/NDC.h>
\r
44 #include <xmltooling/util/StorageService.h>
\r
45 #include <xmltooling/util/XMLHelper.h>
\r
46 #include <xercesc/util/XMLUniDefs.hpp>
\r
48 using namespace shibsp;
\r
49 using namespace opensaml::saml2md;
\r
50 using namespace opensaml;
\r
51 using namespace xmltooling;
\r
52 using namespace log4cpp;
\r
53 using namespace std;
\r
58 class StoredSession : public virtual Session
\r
61 StoredSession(SSCache* cache, const Application& app, DDF& obj)
\r
62 : m_appId(app.getId()), m_obj(obj), m_cache(cache) {
\r
63 const char* nameid = obj["nameid"].string();
\r
65 throw FatalProfileException("NameID missing from cached session.");
\r
67 // Parse and bind the document into an XMLObject.
\r
68 istringstream instr(nameid);
\r
69 DOMDocument* doc = XMLToolingConfig::getConfig().getParser().parse(instr);
\r
70 XercesJanitor<DOMDocument> janitor(doc);
\r
71 auto_ptr<saml2::NameID> n(saml2::NameIDBuilder::buildNameID());
\r
72 n->unmarshall(doc->getDocumentElement(), true);
\r
76 DDF attrs = m_obj["attributes"];
\r
77 unmarshallAttributes(attrs);
\r
80 for_each(m_attributes.begin(), m_attributes.end(), xmltooling::cleanup<Attribute>());
\r
84 m_nameid = n.release();
\r
96 const char* getClientAddress() const {
\r
97 return m_obj["client_addr"].string();
\r
99 const char* getEntityID() const {
\r
100 return m_obj["entity_id"].string();
\r
102 const char* getAuthnInstant() const {
\r
103 return m_obj["authn_instant"].string();
\r
105 const opensaml::saml2::NameID& getNameID() const {
\r
108 const char* getSessionIndex() const {
\r
109 return m_obj["session_index"].string();
\r
111 const char* getAuthnContextClassRef() const {
\r
112 return m_obj["authncontext_class"].string();
\r
114 const char* getAuthnContextDeclRef() const {
\r
115 return m_obj["authncontext_decl"].string();
\r
117 const vector<const Attribute*>& getAttributes() const {
\r
118 return m_attributes;
\r
120 const vector<const char*>& getAssertionIDs() const {
\r
121 if (m_ids.empty()) {
\r
122 DDF id = m_obj["assertions"].first();
\r
123 while (id.isstring()) {
\r
124 m_ids.push_back(id.name());
\r
131 void addAttributes(const vector<Attribute*>& attributes);
\r
132 const RootObject* getAssertion(const char* id) const;
\r
133 void addAssertion(RootObject* assertion);
\r
136 void unmarshallAttributes(DDF& in);
\r
140 saml2::NameID* m_nameid;
\r
141 vector<const Attribute*> m_attributes;
\r
142 mutable vector<const char*> m_ids;
\r
143 mutable map<string,RootObject*> m_tokens;
\r
147 class SSCache : public SessionCache, public virtual Remoted
\r
150 SSCache(const DOMElement* e);
\r
153 void receive(DDF& in, ostream& out);
\r
157 const Application& application,
\r
158 const char* client_addr,
\r
159 const saml2md::EntityDescriptor* issuer,
\r
160 const saml2::NameID& nameid,
\r
161 const char* authn_instant=NULL,
\r
162 const char* session_index=NULL,
\r
163 const char* authncontext_class=NULL,
\r
164 const char* authncontext_decl=NULL,
\r
165 const RootObject* ssoToken=NULL,
\r
166 const vector<Attribute*>* attributes=NULL
\r
168 Session* find(const char* key, const Application& application, const char* client_addr=NULL, time_t timeout=0);
\r
169 void remove(const char* key, const Application& application, const char* client_addr);
\r
172 StorageService* m_storage;
\r
175 SessionCache* SHIBSP_DLLLOCAL StorageServiceCacheFactory(const DOMElement* const & e)
\r
177 return new SSCache(e);
\r
180 static const XMLCh _StorageService[] = UNICODE_LITERAL_14(S,t,o,r,a,g,e,S,e,r,v,i,c,e);
\r
183 StoredSession::~StoredSession()
\r
187 for_each(m_attributes.begin(), m_attributes.end(), xmltooling::cleanup<Attribute>());
\r
188 for_each(m_tokens.begin(), m_tokens.end(), xmltooling::cleanup_pair<string,RootObject>());
\r
191 void StoredSession::unmarshallAttributes(DDF& in)
\r
193 DDF attr = in.first();
\r
194 while (!attr.isnull()) {
\r
196 m_attributes.push_back(Attribute::unmarshall(attr));
\r
197 if (m_cache->m_log.isDebugEnabled())
\r
198 m_cache->m_log.debug("unmarshalled attribute (ID: %s) with %d value%s",
\r
199 attr.first().name(), attr.first().integer(), attr.first().integer()!=1 ? "s" : "");
\r
201 catch (AttributeException& ex) {
\r
202 const char* id = attr.first().name();
\r
203 m_cache->m_log.error("error unmarshalling attribute (ID: %s): %s", id ? id : "none", ex.what());
\r
205 attr = attr.next();
\r
209 void StoredSession::addAttributes(const vector<Attribute*>& attributes)
\r
212 xmltooling::NDC ndc("addAttributes");
\r
215 m_cache->m_log.debug("adding attributes to session (%s)", m_obj.name());
\r
220 DDF attrs = m_obj["attributes"];
\r
221 if (!attrs.islist())
\r
222 attrs = m_obj.addmember("attributes").list();
\r
223 for (vector<Attribute*>::const_iterator a=attributes.begin(); a!=attributes.end(); ++a) {
\r
224 attr = (*a)->marshall();
\r
228 // Tentatively increment the version.
\r
229 m_obj["version"].integer(m_obj["version"].integer()+1);
\r
233 string record(str.str());
\r
235 ver = m_cache->m_storage->updateText(m_appId.c_str(), m_obj.name(), record.c_str(), 0, m_obj["version"].integer()-1);
\r
237 // Roll back modification to record.
\r
238 m_obj["version"].integer(m_obj["version"].integer()-1);
\r
239 vector<Attribute*>::size_type count = attributes.size();
\r
241 attrs.last().destroy();
\r
244 // Fatal problem with update.
\r
245 m_cache->m_log.error("updateText failed on StorageService for session (%s)", m_obj.name());
\r
246 throw IOException("Unable to update stored session.");
\r
248 else if (ver < 0) {
\r
250 m_cache->m_log.warn("storage service indicates the record is out of sync, updating with a fresh copy...");
\r
251 ver = m_cache->m_storage->readText(m_appId.c_str(), m_obj.name(), &record, NULL);
\r
253 m_cache->m_log.error("readText failed on StorageService for session (%s)", m_obj.name());
\r
254 throw IOException("Unable to read back stored session.");
\r
259 istringstream in(record);
\r
263 for_each(m_attributes.begin(), m_attributes.end(), xmltooling::cleanup<Attribute>());
\r
264 m_attributes.clear();
\r
265 newobj["version"].integer(ver);
\r
268 DDF attrs = m_obj["attributes"];
\r
269 unmarshallAttributes(attrs);
\r
273 } while (ver < 0); // negative indicates a sync issue so we retry
\r
275 // Transfer ownership to us.
\r
276 m_attributes.insert(m_attributes.end(), attributes.begin(), attributes.end());
\r
278 TransactionLog* xlog = SPConfig::getConfig().getServiceProvider()->getTransactionLog();
\r
279 Locker locker(xlog);
\r
280 xlog->log.infoStream() <<
\r
281 "Added the following attributes to session (ID: " <<
\r
283 ") for (applicationId: " <<
\r
286 for (vector<Attribute*>::const_iterator a=attributes.begin(); a!=attributes.end(); ++a)
\r
287 xlog->log.infoStream() << "\t" << (*a)->getId() << " (" << (*a)->valueCount() << " values)";
\r
288 xlog->log.info("}");
\r
291 const RootObject* StoredSession::getAssertion(const char* id) const
\r
293 map<string,RootObject*>::const_iterator i = m_tokens.find(id);
\r
294 if (i!=m_tokens.end())
\r
297 // Parse and bind the document into an XMLObject.
\r
298 const char* tokenstr = m_obj["assertions"][id].string();
\r
300 throw FatalProfileException("Assertion not found in cache.");
\r
301 istringstream instr(tokenstr);
\r
302 DOMDocument* doc = XMLToolingConfig::getConfig().getParser().parse(instr);
\r
303 XercesJanitor<DOMDocument> janitor(doc);
\r
304 auto_ptr<XMLObject> xmlObject(XMLObjectBuilder::buildOneFromElement(doc->getDocumentElement(), true));
\r
307 RootObject* token = dynamic_cast<RootObject*>(xmlObject.get());
\r
308 if (!token || !token->isAssertion())
\r
309 throw FatalProfileException("Request for cached assertion returned an unknown object type.");
\r
311 // Transfer ownership to us.
\r
312 xmlObject.release();
\r
313 m_tokens[id]=token;
\r
317 void StoredSession::addAssertion(RootObject* assertion)
\r
320 xmltooling::NDC ndc("addAssertion");
\r
323 if (!assertion || !assertion->isAssertion())
\r
324 throw FatalProfileException("Unknown object type passed to session for storage.");
\r
326 auto_ptr_char id(assertion->getID());
\r
328 m_cache->m_log.debug("adding assertion (%s) to session (%s)", id.get(), m_obj.name());
\r
335 DDF token = m_obj["assertions"];
\r
336 if (!token.isstruct())
\r
337 token = m_obj.addmember("assertions").structure();
\r
338 token = token.addmember(id.get()).string(os.str().c_str());
\r
340 // Tentatively increment the version.
\r
341 m_obj["version"].integer(m_obj["version"].integer()+1);
\r
345 string record(str.str());
\r
347 ver = m_cache->m_storage->updateText(m_appId.c_str(), m_obj.name(), record.c_str(), 0, m_obj["version"].integer()-1);
\r
350 m_obj["version"].integer(m_obj["version"].integer()-1);
\r
353 // Fatal problem with update.
\r
354 m_cache->m_log.error("updateText failed on StorageService for session (%s)", m_obj.name());
\r
355 throw IOException("Unable to update stored session.");
\r
357 else if (ver < 0) {
\r
359 m_cache->m_log.warn("storage service indicates the record is out of sync, updating with a fresh copy...");
\r
360 ver = m_cache->m_storage->readText(m_appId.c_str(), m_obj.name(), &record, NULL);
\r
362 m_cache->m_log.error("readText failed on StorageService for session (%s)", m_obj.name());
\r
363 throw IOException("Unable to read back stored session.");
\r
368 istringstream in(record);
\r
372 for_each(m_attributes.begin(), m_attributes.end(), xmltooling::cleanup<Attribute>());
\r
373 m_attributes.clear();
\r
374 newobj["version"].integer(ver);
\r
377 DDF attrs = m_obj["attributes"];
\r
378 unmarshallAttributes(attrs);
\r
382 } while (ver < 0); // negative indicates a sync issue so we retry
\r
386 TransactionLog* xlog = SPConfig::getConfig().getServiceProvider()->getTransactionLog();
\r
387 Locker locker(xlog);
\r
389 "Added assertion (ID: %s) to session for (applicationId: %s) with (ID: %s)",
\r
390 id.get(), m_appId.c_str(), m_obj.name()
\r
394 SSCache::SSCache(const DOMElement* e)
\r
395 : SessionCache(e), m_log(Category::getInstance(SHIBSP_LOGCAT".SessionCache")), m_storage(NULL)
\r
397 SPConfig& conf = SPConfig::getConfig();
\r
398 const XMLCh* tag = e ? e->getAttributeNS(NULL,_StorageService) : NULL;
\r
400 auto_ptr_char ssid(tag);
\r
401 m_storage = conf.getServiceProvider()->getStorageService(ssid.get());
\r
403 m_log.info("bound to StorageService (%s)", ssid.get());
\r
405 throw ConfigurationException("SessionCache unable to locate StorageService, check configuration.");
\r
408 ListenerService* listener=conf.getServiceProvider()->getListenerService(false);
\r
409 if (listener && conf.isEnabled(SPConfig::OutOfProcess)) {
\r
410 listener->regListener("insert::"REMOTED_SESSION_CACHE,this);
\r
411 listener->regListener("find::"REMOTED_SESSION_CACHE,this);
\r
412 listener->regListener("remove::"REMOTED_SESSION_CACHE,this);
\r
415 m_log.info("no ListenerService available, cache remoting is disabled");
\r
419 string SSCache::insert(
\r
421 const Application& application,
\r
422 const char* client_addr,
\r
423 const saml2md::EntityDescriptor* issuer,
\r
424 const saml2::NameID& nameid,
\r
425 const char* authn_instant,
\r
426 const char* session_index,
\r
427 const char* authncontext_class,
\r
428 const char* authncontext_decl,
\r
429 const RootObject* ssoToken,
\r
430 const vector<Attribute*>* attributes
\r
434 xmltooling::NDC ndc("insert");
\r
437 m_log.debug("creating new session");
\r
439 auto_ptr_char key(SAMLConfig::getConfig().generateIdentifier());
\r
441 // Store session properties in DDF.
\r
442 DDF obj = DDF(key.get()).structure();
\r
443 obj.addmember("version").integer(1);
\r
445 // On 64-bit Windows, time_t doesn't fit in a long, so I'm using ISO timestamps.
\r
446 #ifndef HAVE_GMTIME_R
\r
447 struct tm* ptime=gmtime(&expires);
\r
450 struct tm* ptime=gmtime_r(&expires,&res);
\r
453 strftime(timebuf,32,"%Y-%m-%dT%H:%M:%SZ",ptime);
\r
454 obj.addmember("expires").string(timebuf);
\r
456 obj.addmember("client_addr").string(client_addr);
\r
458 auto_ptr_char entity_id(issuer->getEntityID());
\r
459 obj.addmember("entity_id").string(entity_id.get());
\r
462 obj.addmember("authn_instant").string(authn_instant);
\r
464 obj.addmember("session_index").string(session_index);
\r
465 if (authncontext_class)
\r
466 obj.addmember("authncontext_class").string(authncontext_class);
\r
467 if (authncontext_decl)
\r
468 obj.addmember("authncontext_decl").string(authncontext_decl);
\r
470 ostringstream namestr;
\r
472 obj.addmember("nameid").string(namestr.str().c_str());
\r
475 ostringstream tokenstr;
\r
476 tokenstr << *ssoToken;
\r
477 auto_ptr_char tokenid(ssoToken->getID());
\r
478 obj.addmember("assertions").structure().addmember(tokenid.get()).string(tokenstr.str().c_str());
\r
483 DDF attrlist = obj.addmember("attributes").list();
\r
484 for (vector<Attribute*>::const_iterator a=attributes->begin(); a!=attributes->end(); ++a) {
\r
485 attr = (*a)->marshall();
\r
486 attrlist.add(attr);
\r
490 ostringstream record;
\r
493 m_log.debug("storing new session...");
\r
494 m_storage->createText(application.getId(), key.get(), record.str().c_str(), time(NULL) + m_cacheTimeout);
\r
495 const char* pid = obj["entity_id"].string();
\r
496 m_log.debug("new session created: SessionID (%s) IdP (%s) Address (%s)", key.get(), pid ? pid : "none", client_addr);
\r
498 // Transaction Logging
\r
499 auto_ptr_char name(nameid.getName());
\r
500 TransactionLog* xlog = SPConfig::getConfig().getServiceProvider()->getTransactionLog();
\r
501 Locker locker(xlog);
\r
502 xlog->log.infoStream() <<
\r
503 "New session (ID: " <<
\r
505 ") with (applicationId: " <<
\r
506 application.getId() <<
\r
507 ") for principal from (IdP: " <<
\r
508 (pid ? pid : "none") <<
\r
509 ") at (ClientAddress: " <<
\r
511 ") with (NameIdentifier: " <<
\r
518 Session* SSCache::find(const char* key, const Application& application, const char* client_addr, time_t timeout)
\r
521 xmltooling::NDC ndc("find");
\r
524 m_log.debug("searching for session (%s)", key);
\r
528 int ver = m_storage->readText(application.getId(), key, &record, &lastAccess);
\r
532 m_log.debug("reconstituting session and checking for validity");
\r
535 istringstream in(record);
\r
538 lastAccess -= m_cacheTimeout; // adjusts it back to the last time the record's timestamp was touched
\r
541 if (m_log.isDebugEnabled())
\r
542 m_log.debug("comparing client address %s against %s", client_addr, obj["client_addr"].string());
\r
543 if (strcmp(obj["client_addr"].string(),client_addr)) {
\r
544 m_log.warn("client address mismatch");
\r
545 RetryableProfileException ex(
\r
546 "Your IP address ($1) does not match the address recorded at the time the session was established.",
\r
547 params(1,client_addr)
\r
549 string eid(obj["entity_id"].string());
\r
553 MetadataProvider* m=application.getMetadataProvider();
\r
555 annotateException(&ex,m->getEntityDescriptor(eid.c_str(),false)); // throws it
\r
559 time_t now=time(NULL);
\r
561 if (timeout > 0 && now - lastAccess >= timeout) {
\r
562 m_log.info("session timed out (ID: %s)", key);
\r
563 RetryableProfileException ex("Your session has expired, and you must re-authenticate.");
\r
564 string eid(obj["entity_id"].string());
\r
568 MetadataProvider* m=application.getMetadataProvider();
\r
570 annotateException(&ex,m->getEntityDescriptor(eid.c_str(),false)); // throws it
\r
573 auto_ptr_XMLCh exp(obj["expires"].string());
\r
575 DateTime iso(exp.get());
\r
576 iso.parseDateTime();
\r
577 if (now > iso.getEpoch()) {
\r
578 m_log.info("session expired (ID: %s)", key);
\r
579 RetryableProfileException ex("Your session has expired, and you must re-authenticate.");
\r
580 string eid(obj["entity_id"].string());
\r
584 MetadataProvider* m=application.getMetadataProvider();
\r
586 annotateException(&ex,m->getEntityDescriptor(eid.c_str(),false)); // throws it
\r
590 // Update storage expiration, if possible.
\r
591 if (!m_storage->updateText(application.getId(), key, NULL, now + m_cacheTimeout))
\r
592 m_log.error("failed to update record expiration");
\r
594 // Finally build the Session object.
\r
596 return new StoredSession(this, application, obj);
\r
598 catch (exception&) {
\r
604 void SSCache::remove(const char* key, const Application& application, const char* client_addr)
\r
607 xmltooling::NDC ndc("remove");
\r
610 m_log.debug("removing session (%s)", key);
\r
612 m_storage->deleteText(application.getId(), key);
\r
614 TransactionLog* xlog = SPConfig::getConfig().getServiceProvider()->getTransactionLog();
\r
615 Locker locker(xlog);
\r
616 xlog->log.info("Destroyed session (applicationId: %s) (ID: %s)", application.getId(), key);
\r
619 void SSCache::receive(DDF& in, ostream& out)
\r
622 xmltooling::NDC ndc("receive");
\r
625 // Find application.
\r
626 ServiceProvider* sp = SPConfig::getConfig().getServiceProvider();
\r
627 Locker confLocker(sp);
\r
628 const char* aid=in["application_id"].string();
\r
629 const Application* app=aid ? sp->getApplication(aid) : NULL;
\r
631 // Something's horribly wrong.
\r
632 m_log.error("couldn't find application (%s) for session", aid ? aid : "(missing)");
\r
633 throw ConfigurationException("Unable to locate application for session, deleted?");
\r
636 if (!strcmp(in.name(),"insert::"REMOTED_SESSION_CACHE)) {
\r
637 in["application_id"].destroy();
\r
638 auto_ptr_char key(SAMLConfig::getConfig().generateIdentifier());
\r
639 in.name(key.get());
\r
641 m_log.debug("storing new session...");
\r
642 ostringstream record;
\r
644 m_storage->createText(app->getId(), key.get(), record.str().c_str(), time(NULL) + m_cacheTimeout);
\r
645 const char* pid = in["entity_id"].string();
\r
646 m_log.debug("new session created: SessionID (%s) IdP (%s) Address (%s)", key.get(), pid ? pid : "none", in["client_addr"].string());
\r
648 DDF ret = DDF(NULL).structure();
\r
649 DDFJanitor jan(ret);
\r
650 ret.addmember("key").string(key.get());
\r
653 else if (!strcmp(in.name(),"find::"REMOTED_SESSION_CACHE)) {
\r
654 const char* key=in["key"].string();
\r
656 throw ListenerException("Required parameters missing for session removal.");
\r
658 // Do an unversioned read.
\r
661 if (!m_storage->readText(aid, key, &record, &lastAccess)) {
\r
663 DDFJanitor jan(ret);
\r
668 // Adjust for expiration to recover last access time and check timeout.
\r
669 lastAccess -= m_cacheTimeout;
\r
670 time_t now=time(NULL);
\r
672 // See if we need to check for a timeout.
\r
673 time_t timeout = 0;
\r
674 auto_ptr_XMLCh dt(in["timeout"].string());
\r
676 DateTime dtobj(dt.get());
\r
677 dtobj.parseDateTime();
\r
678 timeout = dtobj.getEpoch();
\r
681 if (timeout > 0 && now - lastAccess >= timeout) {
\r
682 m_log.info("session timed out (ID: %s)", key);
\r
683 throw RetryableProfileException("Your session has expired, and you must re-authenticate.");
\r
686 // Update storage expiration, if possible.
\r
687 if (!m_storage->updateText(aid, key, NULL, now + m_cacheTimeout))
\r
688 m_log.error("failed to update record expiration");
\r
690 // Send the record back.
\r
693 else if (!strcmp(in.name(),"touch::"REMOTED_SESSION_CACHE)) {
\r
694 const char* key=in["key"].string();
\r
696 throw ListenerException("Required parameters missing for session check.");
\r
698 // Do a versioned read.
\r
701 int curver = in["version"].integer();
\r
702 int ver = m_storage->readText(aid, key, &record, &lastAccess, curver);
\r
704 m_log.warn("unsuccessful versioned read of session (ID: %s), caches out of sync?", key);
\r
705 throw RetryableProfileException("Your session has expired, and you must re-authenticate.");
\r
708 // Adjust for expiration to recover last access time and check timeout.
\r
709 lastAccess -= m_cacheTimeout;
\r
710 time_t now=time(NULL);
\r
712 // See if we need to check for a timeout.
\r
713 time_t timeout = 0;
\r
714 auto_ptr_XMLCh dt(in["timeout"].string());
\r
716 DateTime dtobj(dt.get());
\r
717 dtobj.parseDateTime();
\r
718 timeout = dtobj.getEpoch();
\r
721 if (timeout > 0 && now - lastAccess >= timeout) {
\r
722 m_log.info("session timed out (ID: %s)", key);
\r
723 throw RetryableProfileException("Your session has expired, and you must re-authenticate.");
\r
726 // Update storage expiration, if possible.
\r
727 if (!m_storage->updateText(aid, key, NULL, now + m_cacheTimeout))
\r
728 m_log.error("failed to update record expiration");
\r
730 if (ver > curver) {
\r
731 // Send the record back.
\r
736 DDFJanitor jan(ret);
\r
740 else if (!strcmp(in.name(),"remove::"REMOTED_SESSION_CACHE)) {
\r
741 const char* key=in["key"].string();
\r
742 const char* client_addr=in["client_addr"].string();
\r
743 if (!key || !client_addr)
\r
744 throw ListenerException("Required parameters missing for session removal.");
\r
746 remove(key,*app,client_addr);
\r
748 DDFJanitor jan(ret);
\r