summaryrefslogtreecommitdiff
path: root/server/src/connection.cc
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/connection.cc')
-rw-r--r--server/src/connection.cc6
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;
}