From 653eb23b01c2066daccfe9f29ae1044802ef7481 Mon Sep 17 00:00:00 2001 From: deva Date: Mon, 14 Jun 2010 12:25:23 +0000 Subject: Isolated all microhttpd code in Httpd class. --- server/src/connection.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'server/src/connection.cc') diff --git a/server/src/connection.cc b/server/src/connection.cc index ed5a7a9..43d1ea9 100644 --- a/server/src/connection.cc +++ b/server/src/connection.cc @@ -57,6 +57,7 @@ Connection::Connection(Environment &e, std::string sid, bool c, bool d) did_commit = false; #endif + parser_complete = false; } Connection::~Connection() @@ -116,6 +117,8 @@ bool Connection::handle(const char *data, size_t size) } if(parser.parse(data, size)) { + parser_complete = true; + { SessionAutolock lock(*session); response = handleTransaction(transaction, env, *session); @@ -123,6 +126,7 @@ bool Connection::handle(const char *data, size_t size) commit(session); discard(session); + return true; } } catch(...) { @@ -136,6 +140,8 @@ bool Connection::handle(const char *data, size_t size) std::string Connection::getResponse() { + if(parser_complete == false) + return error_box(xml_encode("XML Parser need more data.")); return response; } -- cgit v1.2.3