+private:
+ NETTRANSACT nt;
+
+ std::string errorMsg;
+ XML_Parser parser;
+
+ static bool ParserRecv(const std::string & chunk, bool final, void * data);
+ static bool SimpleRecv(const std::string & chunk, bool final, void * data);
+ int ExecImpl(const std::string & request, PARSER & cp);
+};
+
+bool SERVCONF::IMPL::ParserRecv(const std::string & chunk, bool final, void * data)
+{
+SERVCONF::IMPL * sc = static_cast<SERVCONF::IMPL *>(data);
+
+if (XML_Parse(sc->parser, chunk.c_str(), chunk.length(), final) == XML_STATUS_ERROR)
+ {
+ strprintf(&sc->errorMsg, "XML parse error at line %d: %s",
+ static_cast<int>(XML_GetCurrentLineNumber(sc->parser)),
+ XML_ErrorString(XML_GetErrorCode(sc->parser)));
+ printf("%s\n", sc->errorMsg.c_str());
+ return false;
+ }
+
+return true;