X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/8f1d13e63e83c5f590d59f6d09f2d1dae69ba526..e3703f791ff52f6d7a9d6f9e8dca37a506967c2b:/stglibs/srvconf.lib/servconf.cpp?ds=inline diff --git a/stglibs/srvconf.lib/servconf.cpp b/stglibs/srvconf.lib/servconf.cpp index d7df4704..2f4afaba 100644 --- a/stglibs/srvconf.lib/servconf.cpp +++ b/stglibs/srvconf.lib/servconf.cpp @@ -92,17 +92,15 @@ sc->End(el); //----------------------------------------------------------------------------- SERVCONF::SERVCONF() : currParser(NULL), - parseDepth(0), error(0), RecvUserDataCb(NULL), RecvGetUserDataCb(NULL), - authByCallback(NULL), RecvServerInfoDataCb(NULL), RecvChgUserCb(NULL), RecvCheckUserCb(NULL), RecvSendMessageCb(NULL), getUserDataDataCb(NULL), - authByData(NULL), + getUserAuthByDataCb(NULL), getUsersDataDataCb(NULL), getServerInfoDataCb(NULL), chgUserDataCb(NULL), @@ -112,6 +110,11 @@ SERVCONF::SERVCONF() parser = XML_ParserCreate(NULL); } //----------------------------------------------------------------------------- +SERVCONF::~SERVCONF() +{ +XML_ParserFree(parser); +} +//----------------------------------------------------------------------------- void SERVCONF::SetServer(const char * server) { nt.SetServer(server); @@ -163,18 +166,18 @@ if ((ret = nt.Disconnect()) != st_ok) return st_ok; } //----------------------------------------------------------------------------- -int SERVCONF::AuthBy(const char * l) +int SERVCONF::GetUserAuthBy(const char * l) { char request[255]; snprintf(request, 255, "", l); +int ret; currParser = &parserAuthBy; -((PARSER_AUTH_BY*)currParser)->SetCallback(authByCallback, authByData); +((PARSER_AUTH_BY*)currParser)->SetRecvCb(RecvAuthByCb, getUserAuthByDataCb); nt.Reset(); nt.SetRxCallback(this, AnsRecv); -int ret; if ((ret = nt.Connect()) != st_ok) { errorMsg = nt.GetError(); @@ -401,10 +404,10 @@ RecvGetUserDataCb = f; //GET_USER getUserDataDataCb = data; } //----------------------------------------------------------------------------- -void SERVCONF::SetAuthByCallback(PARSER_AUTH_BY::CALLBACK f, void * data) +void SERVCONF::SetGetUserAuthByRecvCb(RecvAuthByDataCb_t f, void * data) { -authByCallback = f; -authByData = data; +RecvAuthByCb = f; +getUserAuthByDataCb = data; } //----------------------------------------------------------------------------- void SERVCONF::SetServerInfoRecvCb(RecvServerInfoDataCb_t f, void * data)