From 9ec9a98e83076bb339d1d546fa445b2420e5a4fb Mon Sep 17 00:00:00 2001 From: deva Date: Fri, 4 Feb 2011 07:35:10 +0000 Subject: A new connection handling mechanism. --- server/src/connection.h | 37 ++++--------------------------------- 1 file changed, 4 insertions(+), 33 deletions(-) (limited to 'server/src/connection.h') diff --git a/server/src/connection.h b/server/src/connection.h index e9a4e50..153e865 100644 --- a/server/src/connection.h +++ b/server/src/connection.h @@ -29,43 +29,14 @@ #define __PRACRO_CONNECTION_H__ #include -#include "environment.h" -#include "transaction.h" -#include "transactionparser.h" -class Session; +#include "httpd.h" class Connection { public: - Connection(Environment &e, std::string sessionid, - std::string patientid, std::string templ, - bool commit, bool discard, bool nocommit); - ~Connection(); - - bool handle(const char *data, size_t size); - - std::string getResponse(); - std::string getSessionID(); - -private: - void commit(Session *session); - void nocommit(Session *session); - void discard(Session *session); - - std::string patientid; - std::string templ; - std::string sessionid; - bool docommit; - bool donocommit; - bool dodiscard; - Environment &env; - - Transaction transaction; - TransactionParser parser; - - std::string response; - - bool parser_complete; + virtual bool handle(const char *data, size_t size) = 0; + virtual std::string getResponse() = 0; + virtual headers_t getHeaders() = 0; }; #endif/*__PRACRO_CONNECTION_H__*/ -- cgit v1.2.3