summaryrefslogtreecommitdiff
path: root/server/src/server.cc
diff options
context:
space:
mode:
authordeva <deva>2011-02-07 11:15:52 +0000
committerdeva <deva>2011-02-07 11:15:52 +0000
commit4ea34b413bd21c0e8ec4c3b93840bfe928d3c9c4 (patch)
tree693c2416ad98911b98b2249c324de640841bfa20 /server/src/server.cc
parent1f3b20415c59ce08479d9291b92bbe5ffa8b2f6c (diff)
Cleaned up the Connection interface a bit.
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;