]> git.stg.codes - stg.git/blobdiff - stglibs/srvconf.lib/servconf.cpp
Merge branch 'stg-2.409'
[stg.git] / stglibs / srvconf.lib / servconf.cpp
index 78db78c8fd8f335d696c984d52821aa1d1624b1f..046190ee25bcf9381d69cb5876a4cd8de95decb4 100644 (file)
@@ -111,7 +111,6 @@ if (XML_Parse(sc->parser, chunk.c_str(), chunk.length(), final) == XML_STATUS_ER
               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;
     }
 
@@ -281,7 +280,7 @@ return pImpl->Exec<GET_SERVICE::PARSER>("<GetService name=\"" + name + "\"/>", f
 
 int SERVCONF::ChgService(const SERVICE_CONF_RES & conf, SIMPLE::CALLBACK f, void * data)
 {
-return pImpl->Exec<SIMPLE::PARSER>("SetService", "<SetService name=\"" + conf.name.data() + "\">" + CHG_SERVICE::Serialize(conf, pImpl->Encoding()) + "</SetService>", f, data);
+return pImpl->Exec<SIMPLE::PARSER>("SetService", "<SetService " + CHG_SERVICE::Serialize(conf, pImpl->Encoding()) + "/>", f, data);
 }
 
 int SERVCONF::AddService(const std::string & name,
@@ -291,7 +290,7 @@ int SERVCONF::AddService(const std::string & name,
 int res = pImpl->Exec<SIMPLE::PARSER>("AddService", "<AddService name=\"" + name + "\"/>", f, data);
 if (res != st_ok)
     return res;
-return pImpl->Exec<SIMPLE::PARSER>("SetService", "<SetService name=\"" + name + "\">" + CHG_SERVICE::Serialize(conf, pImpl->Encoding()) + "</SetService>", f, data);
+return pImpl->Exec<SIMPLE::PARSER>("SetService", "<SetService " + CHG_SERVICE::Serialize(conf, pImpl->Encoding()) + "/>", f, data);
 }
 
 int SERVCONF::DelService(const std::string & name, SIMPLE::CALLBACK f, void * data)
@@ -342,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);
 }
@@ -352,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);
 }