From 775d9c9c11f3906766c0dc7070eb7ef01606ef96 Mon Sep 17 00:00:00 2001 From: deva Date: Fri, 28 Jan 2011 08:50:42 +0000 Subject: New cross client system. --- server/src/connection.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'server/src/connection.cc') diff --git a/server/src/connection.cc b/server/src/connection.cc index dd76f97..e4ec7f4 100644 --- a/server/src/connection.cc +++ b/server/src/connection.cc @@ -44,11 +44,15 @@ static std::string error_box(std::string message) static bool did_commit = false; #endif -Connection::Connection(Environment &e, std::string sid, bool c, bool d, bool nc) +Connection::Connection(Environment &e, std::string sid, + std::string pid, std::string t, + bool c, bool d, bool nc) : env(e), parser(&transaction) { DEBUG(connection, "[%p] CREATE\n", this); + patientid = pid; + templ = t; sessionid = sid; docommit = c; dodiscard = d; @@ -104,13 +108,13 @@ bool Connection::handle(const char *data, size_t size) Session *session = NULL; if(sessionid == "") { // Create new session - session = env.sessions.newSession(); + session = env.sessions.newSession(patientid, templ); } else { // Attach to old session session = env.sessions.session(sessionid); // Session didn't exist - create a new one anyway. - if(session == NULL) session = env.sessions.newSession(); + if(session == NULL) session = env.sessions.newSession(patientid, templ); } if(session == NULL) { -- cgit v1.2.3