summaryrefslogtreecommitdiff
path: root/server/src/session.cc
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/session.cc')
-rw-r--r--server/src/session.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/server/src/session.cc b/server/src/session.cc
index 6880e73..24a9c12 100644
--- a/server/src/session.cc
+++ b/server/src/session.cc
@@ -84,23 +84,23 @@ void Session::unlock()
mutex.unlock();
}
-bool Session::active()
+bool Session::idle()
{
- if(isreadonly) return true;
+ if(isreadonly) return false;
{
AutoBorrower<Database*> borrower(env->dbpool);
Database *db = borrower.get();
- return db->active(id());
+ return db->idle(id());
}
}
-void Session::setActive(bool a)
+void Session::setIdle(bool idle)
{
if(isreadonly == false) {
AutoBorrower<Database*> borrower(env->dbpool);
Database *db = borrower.get();
- return db->setActive(id(), a);
+ return db->setIdle(id(), idle);
}
}
@@ -185,7 +185,7 @@ Session *Sessions::newSession(std::string patientid, std::string templ)
if(i->second->patientid == patientid &&
i->second->templ == templ) {
Session *session = i->second;
- if(session->active()) throw SessionAlreadyActive(session->id());
+ if(!session->idle()) throw SessionAlreadyActive(session->id());
return session;
}
@@ -197,7 +197,7 @@ Session *Sessions::newSession(std::string patientid, std::string templ)
Session *session = ser.findFromTupple(patientid, templ);
if(session) {
sessions[session->id()] = session;
- if(session->active()) throw SessionAlreadyActive(session->id());
+ if(!session->idle()) throw SessionAlreadyActive(session->id());
return session;
}
}