diff options
author | randomdan <randomdan@localhost> | 2013-05-31 19:20:43 +0000 |
---|---|---|
committer | randomdan <randomdan@localhost> | 2013-05-31 19:20:43 +0000 |
commit | cd60b3e44486712cecbdc983b178ef7e33e0d25d (patch) | |
tree | f395b5fe2763e1daae60fff1ef62e833f312c74d /project2/cgi | |
parent | Minor tidy up and localise (diff) | |
download | project2-cd60b3e44486712cecbdc983b178ef7e33e0d25d.tar.bz2 project2-cd60b3e44486712cecbdc983b178ef7e33e0d25d.tar.xz project2-cd60b3e44486712cecbdc983b178ef7e33e0d25d.zip |
Remove the now pointless wrapper around UUIDs
Diffstat (limited to 'project2/cgi')
-rw-r--r-- | project2/cgi/cgiAppEngine.cpp | 13 | ||||
-rw-r--r-- | project2/cgi/cgiAppEngine.h | 1 |
2 files changed, 8 insertions, 6 deletions
diff --git a/project2/cgi/cgiAppEngine.cpp b/project2/cgi/cgiAppEngine.cpp index 799196d..9f72b31 100644 --- a/project2/cgi/cgiAppEngine.cpp +++ b/project2/cgi/cgiAppEngine.cpp @@ -10,9 +10,12 @@ #include "ostreamWrapper.h" #include "scopeObject.h" #include <boost/date_time/microsec_time_clock.hpp> +#include <boost/uuid/uuid_io.hpp> +#include <boost/uuid/uuid_generators.hpp> +#include <boost/lexical_cast.hpp> const std::string SESSIONID = "sessionID"; -typedef UUID SIDKey; +typedef boost::uuids::uuid SIDKey; typedef std::string SValue; SimpleMessageException(UnknownDomain); @@ -24,10 +27,10 @@ CgiApplicationEngine::CgiApplicationEngine(const CgiEnvironment * e, std::ostrea outputCachingActive(false) { try { - cursession = sessionsContainer->GetSession(e->getCookieValue(SESSIONID)); + cursession = sessionsContainer->GetSession(boost::uuids::string_generator()(e->getCookieValue(SESSIONID))); } catch (const NoSuchCookie &) { - cursession = sessionsContainer->GetSession(UUID()); + cursession = sessionsContainer->GetSession(boost::uuids::uuid()); } } @@ -101,7 +104,7 @@ CgiApplicationEngine::process() const HttpHeaderPtr header = rs->getHeader(); if (!sessionEmpty || !cursession->Empty()) { sessionsContainer->SaveSession(cursession); - header->setCookie(cgicc::HTTPCookie(SESSIONID, cursession->ID().str(), "Session ID", + header->setCookie(cgicc::HTTPCookie(SESSIONID, boost::lexical_cast<std::string>(cursession->ID()), "Session ID", _env->getServerName().substr(_env->getServerName().find(".")), env()->sessionTimeOut, "/", false)); } if (TransformSourcePtr ts = currentStage.get<2>()) { @@ -207,7 +210,7 @@ CgiApplicationEngine::addAppData(const MultiRowSetPresenter * p, OutputOptionsPt if (!outputCachingActive && (!cursession->Empty()) && (!o || o->Session())) { // Sessions variables p->addNewRowSet("session", env()->scriptNamespacePrefix); - p->addAttribute("id", cursession->ID().str()); + p->addAttribute("id", boost::lexical_cast<Glib::ustring>(cursession->ID())); cursession->ForeachValue(boost::bind(&CgiApplicationEngine::addVarToPresenter, this, p, _1, _2)); p->finishRowSet(); } diff --git a/project2/cgi/cgiAppEngine.h b/project2/cgi/cgiAppEngine.h index 69767be..f5f0e08 100644 --- a/project2/cgi/cgiAppEngine.h +++ b/project2/cgi/cgiAppEngine.h @@ -4,7 +4,6 @@ #include "appEngine.h" #include "task.h" #include "commonObjects.h" -#include "uuid.h" #include "taskHost.h" #include "viewHost.h" #include "transform.h" |