+ const std::string & Encoding() const { return encoding; }
+
+private:
+ NETTRANSACT nt;
+
+ std::string encoding;
+ 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, %d: %s. Is final: %d",
+ static_cast<int>(XML_GetCurrentLineNumber(sc->parser)),
+ static_cast<int>(XML_GetCurrentColumnNumber(sc->parser)),
+ XML_ErrorString(XML_GetErrorCode(sc->parser)), (int)final);
+ printf("%s\n", sc->errorMsg.c_str());
+ return false;