X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/d084d9ae9f7bcd7f7d1926e7eeae921dbad49273..faf619a9b927923d90782ab28734916197ff16b4:/stglibs/srvconf.lib/servconf.cpp?ds=sidebyside diff --git a/stglibs/srvconf.lib/servconf.cpp b/stglibs/srvconf.lib/servconf.cpp index 4c69c813..046190ee 100644 --- a/stglibs/srvconf.lib/servconf.cpp +++ b/stglibs/srvconf.lib/servconf.cpp @@ -107,10 +107,10 @@ SERVCONF::IMPL * sc = static_cast(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", + strprintf(&sc->errorMsg, "XML parse error at line %d, %d: %s. Is final: %d", static_cast(XML_GetCurrentLineNumber(sc->parser)), - XML_ErrorString(XML_GetErrorCode(sc->parser))); - printf("%s\n", sc->errorMsg.c_str()); + static_cast(XML_GetCurrentColumnNumber(sc->parser)), + XML_ErrorString(XML_GetErrorCode(sc->parser)), (int)final); return false; } @@ -280,7 +280,7 @@ return pImpl->Exec("", f int SERVCONF::ChgService(const SERVICE_CONF_RES & conf, SIMPLE::CALLBACK f, void * data) { -return pImpl->Exec("SetService", "" + CHG_SERVICE::Serialize(conf, pImpl->Encoding()) + "", f, data); +return pImpl->Exec("SetService", "Encoding()) + "/>", f, data); } int SERVCONF::AddService(const std::string & name, @@ -290,7 +290,7 @@ int SERVCONF::AddService(const std::string & name, int res = pImpl->Exec("AddService", "", f, data); if (res != st_ok) return res; -return pImpl->Exec("SetService", "" + CHG_SERVICE::Serialize(conf, pImpl->Encoding()) + "", f, data); +return pImpl->Exec("SetService", "Encoding()) + "/>", f, data); } int SERVCONF::DelService(const std::string & name, SIMPLE::CALLBACK f, void * data) @@ -341,6 +341,7 @@ SERVCONF::IMPL::IMPL(const std::string & server, uint16_t port, : nt(server, port, login, password) { setlocale(LC_ALL, ""); +setlocale(LC_NUMERIC, "C"); encoding = nl_langinfo(CODESET); parser = XML_ParserCreate(NULL); } @@ -351,6 +352,7 @@ SERVCONF::IMPL::IMPL(const std::string & server, uint16_t port, : nt(server, port, localAddress, localPort, login, password) { setlocale(LC_ALL, ""); +setlocale(LC_NUMERIC, "C"); encoding = nl_langinfo(CODESET); parser = XML_ParserCreate(NULL); }