summaryrefslogtreecommitdiff
path: root/server/src/server.cc
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/server.cc')
-rw-r--r--server/src/server.cc25
1 files changed, 3 insertions, 22 deletions
diff --git a/server/src/server.cc b/server/src/server.cc
index 745b77b..d9daf3a 100644
--- a/server/src/server.cc
+++ b/server/src/server.cc
@@ -63,19 +63,7 @@ public:
headers["User-Agent"].find("Pracro") == std::string::npos) { // Admin
connection = new AdminConnection(env, getargs, url);
} else { // Pracro client
- ClientConnection::Parameters parms;
- if(headers.contains("SessionID"))
- parms.sessionid = headers["SessionID"];
- if(headers.contains("SessionPatientID"))
- parms.patientid = headers["SessionPatientID"];
- if(headers.contains("SessionTemplate"))
- parms.templ = headers["SessionTemplate"];
-
- parms.commit = headers.contains("SessionCommit");
- parms.nocommit = headers.contains("SessionNoCommit");
- parms.discard = headers.contains("SessionDiscard");
-
- connection = new ClientConnection(env, parms);
+ connection = new ClientConnection(env, headers);
}
return connection;
@@ -95,17 +83,10 @@ public:
if(ptr) {
Connection *connection = (Connection *)ptr;
- // Flush and do commit/discard
+ // Flush and do commit/discards
connection->handle(NULL, 0);
- reply.data = connection->getResponse();
- reply.headers = connection->getHeaders();
- reply.status = 200; // http 'OK'
- } else {
-
- reply.data = "Admin";
- reply.status = 200; // http 'OK'
-
+ connection->getReply(reply);
}
return true;