diff options
author | deva <deva> | 2010-06-14 12:25:23 +0000 |
---|---|---|
committer | deva <deva> | 2010-06-14 12:25:23 +0000 |
commit | 653eb23b01c2066daccfe9f29ae1044802ef7481 (patch) | |
tree | acf25066c13b090d4d44500c9bd0ec4ba4ae1274 /server/src/connection.cc | |
parent | 198b0d886817f2c5bc97cfd11857d4b314dffae3 (diff) |
Isolated all microhttpd code in Httpd class.
Diffstat (limited to 'server/src/connection.cc')
-rw-r--r-- | server/src/connection.cc | 6 |
1 files changed, 6 insertions, 0 deletions
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; } |