- strncpy(ans, node->c_str(), ENC_MSG_LEN);
- ans[ENC_MSG_LEN] = 0;
- //printf("---> %s\n", ans);
- len = strlen(ans);
-
- if (XML_Parse(sc->parser, ans, len, done) == XML_STATUS_ERROR)
- {
- snprintf(sc->errorMsg, MAX_ERR_STR_LEN, "XML parse error at line %d: %s",
- static_cast<int>(XML_GetCurrentLineNumber(sc->parser)),
- XML_ErrorString(XML_GetErrorCode(sc->parser)));
- printf(sc->errorMsg, "XML parse error at line %d: %s",
- XML_GetCurrentLineNumber(sc->parser),
- XML_ErrorString(XML_GetErrorCode(sc->parser)));
- return st_xml_parse_error;
- }
- ++node;
+ P cp(tag, callback, data);
+ return ExecImpl(request, cp);
+ }
+
+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);
+};