]> git.stg.codes - stg.git/blobdiff - stglibs/srvconf.lib/servconf.cpp
Implemented some user management functions.
[stg.git] / stglibs / srvconf.lib / servconf.cpp
index 16878f18112300b1bcee12f8ee13e1681ff32e6d..e7ecfdf4d75a4b0d74b08fd2361336200b665599 100644 (file)
@@ -60,6 +60,7 @@ class SERVCONF::IMPL
 public:
     IMPL(const std::string & server, uint16_t port,
          const std::string & login, const std::string & password);
+    ~IMPL() { XML_ParserFree(parser); }
 
     const std::string & GetStrError() const;
     static void Start(void * data, const char * el, const char ** attr);
@@ -348,11 +349,13 @@ int ret = 0;
 if ((ret = nt.Connect()) != st_ok)
     {
     errorMsg = nt.GetError();
+    cp.Failure(errorMsg);
     return ret;
     }
-if ((ret = nt.Transact(request.c_str(), ParserRecv, this)) != st_ok)
+if ((ret = nt.Transact(request, ParserRecv, this)) != st_ok)
     {
     errorMsg = nt.GetError();
+    cp.Failure(errorMsg);
     return ret;
     }
 
@@ -370,7 +373,7 @@ if ((ret = nt.Connect()) != st_ok)
     return ret;
     }
 std::string response;
-if ((ret = nt.Transact(request.c_str(), SimpleRecv, &response)) != st_ok)
+if ((ret = nt.Transact(request, SimpleRecv, &response)) != st_ok)
     {
     errorMsg = nt.GetError();
     callback(false, errorMsg, "", data);