From 4ea34b413bd21c0e8ec4c3b93840bfe928d3c9c4 Mon Sep 17 00:00:00 2001 From: deva Date: Mon, 7 Feb 2011 11:15:52 +0000 Subject: Cleaned up the Connection interface a bit. --- server/src/server.cc | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) (limited to 'server/src/server.cc') 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; -- cgit v1.2.3