summaryrefslogtreecommitdiff
path: root/server/src/sessionparser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/sessionparser.cc')
-rw-r--r--server/src/sessionparser.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/server/src/sessionparser.cc b/server/src/sessionparser.cc
index ba3693d..0edb26a 100644
--- a/server/src/sessionparser.cc
+++ b/server/src/sessionparser.cc
@@ -34,6 +34,7 @@ SessionParser::SessionParser()
done = false;
totalbytes = 0;
inresume = false;
+ indatabase = false;
}
SessionParser::~SessionParser()
@@ -45,6 +46,10 @@ void SessionParser::characterData(std::string &data)
if(inresume) {
entries[entries.size()-1].resume += data;
}
+
+ if(indatabase) {
+ database += data;
+ }
}
void SessionParser::startTag(std::string name,
@@ -61,6 +66,11 @@ void SessionParser::startTag(std::string name,
userid = attributes["userid"];
}
+ if(name == "database") {
+ dbtype = attributes["type"];
+ indatabase = true;
+ }
+
if(name == "entry") {
Entry e;
e.index = atoi(attributes["index"].c_str());
@@ -78,6 +88,9 @@ void SessionParser::endTag(std::string name)
if(name == "resume") {
inresume = false;
}
+ if(name == "database") {
+ indatabase = false;
+ }
}
void SessionParser::parseError(const char *buf, size_t len,
@@ -87,11 +100,13 @@ void SessionParser::parseError(const char *buf, size_t len,
lineno, error.c_str());
std::string xml;
- xml.append(buf, len);
+ if(buf && len) xml.append(buf, len);
PRACRO_ERR(sessionparser, "\tBuffer %u bytes: [%s]\n",
len, xml.c_str());
+ fflush(stderr);
+
throw std::exception();
}