diff options
author | deva <deva> | 2011-08-02 09:20:51 +0000 |
---|---|---|
committer | deva <deva> | 2011-08-02 09:20:51 +0000 |
commit | abfe526abbf6b0eaa43056d15c178c4f5eb4ff1d (patch) | |
tree | 350d868971f30ac8201d6e6fc33589b9c73a6e99 | |
parent | ed9e290b441a6486c576c2e2e4baa69fa0f3ed37 (diff) |
Fix missing sessionid for the database lookup in QueryHandlerPracro.origin
-rw-r--r-- | server/src/queryhandlerpracro.cc | 6 | ||||
-rw-r--r-- | server/src/queryhandlerpracro.h | 3 | ||||
-rw-r--r-- | server/src/transactionhandler.cc | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/server/src/queryhandlerpracro.cc b/server/src/queryhandlerpracro.cc index d617e69..e95d4ff 100644 --- a/server/src/queryhandlerpracro.cc +++ b/server/src/queryhandlerpracro.cc @@ -32,10 +32,12 @@ #include "configuration.h" -QueryHandlerPracro::QueryHandlerPracro(Database &_db, std::string cpr) +QueryHandlerPracro::QueryHandlerPracro(Database &_db, std::string cpr, + std::string sessionid) : db(_db) { this->cpr = cpr; + this->sessionid = sessionid; } QueryResult QueryHandlerPracro::exec(Query &query) @@ -56,7 +58,7 @@ QueryResult QueryHandlerPracro::exec(Query &query) oldest = time(NULL) - Conf::db_max_ttl; } - Values values = db.getValues(cpr, fields, ""/*no session*/, oldest); + Values values = db.getValues(cpr, fields, sessionid, oldest); if(values.find(field) != values.end()) { std::string value = values[field].value; diff --git a/server/src/queryhandlerpracro.h b/server/src/queryhandlerpracro.h index bdb85db..5029dca 100644 --- a/server/src/queryhandlerpracro.h +++ b/server/src/queryhandlerpracro.h @@ -41,7 +41,7 @@ */ class QueryHandlerPracro : public QueryHandler { public: - QueryHandlerPracro(Database &db, std::string cpr); + QueryHandlerPracro(Database &db, std::string cpr, std::string sessionid); ~QueryHandlerPracro() {} // Execute all queries. @@ -50,6 +50,7 @@ public: private: Database &db; std::string cpr; + std::string sessionid; }; #endif/*__PRACRO_QUERYHANDLERPRACRO_H__*/ diff --git a/server/src/transactionhandler.cc b/server/src/transactionhandler.cc index 0821cef..5203ee2 100644 --- a/server/src/transactionhandler.cc +++ b/server/src/transactionhandler.cc @@ -208,7 +208,7 @@ static std::string handleRequest(Request &request, Environment &env, if(service == "pracro") { // Send the queries to Pentominos (if any) - QueryHandlerPracro qh(*db, request.patientid); + QueryHandlerPracro qh(*db, request.patientid, session.id()); QueryResult queryresult = qh.exec(*qi); lqm.addQueryResult(queryresult); |