diff options
Diffstat (limited to 'server/src/connection.cc')
-rw-r--r-- | server/src/connection.cc | 10 |
1 files changed, 7 insertions, 3 deletions
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) { |