From: Maxim Mamontov Date: Sat, 13 Sep 2014 22:01:14 +0000 (+0300) Subject: Store parser answer in configproto. X-Git-Tag: 2.409~283 X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/bcd21b6aaa556a95a9d0b84b5f8328aadb5c3d3d Store parser answer in configproto. --- diff --git a/projects/stargazer/plugins/configuration/sgconfig/configproto.cpp b/projects/stargazer/plugins/configuration/sgconfig/configproto.cpp index 162f0875..7bc635ab 100644 --- a/projects/stargazer/plugins/configuration/sgconfig/configproto.cpp +++ b/projects/stargazer/plugins/configuration/sgconfig/configproto.cpp @@ -79,6 +79,7 @@ if (cp->currParser) { if (cp->currParser->ParseEnd(data, el) == 0) { + cp->dataAnswer = cp->currParser->GetAnswer(); cp->currParser = NULL; } } @@ -88,6 +89,8 @@ else { if (cp->dataParser[i]->ParseEnd(data, el) == 0) { + cp->dataAnswer = cp->currParser->GetAnswer(); + cp->currParser = NULL; break; } } diff --git a/projects/stargazer/plugins/configuration/sgconfig/configproto.h b/projects/stargazer/plugins/configuration/sgconfig/configproto.h index 4b93d675..206e543b 100644 --- a/projects/stargazer/plugins/configuration/sgconfig/configproto.h +++ b/projects/stargazer/plugins/configuration/sgconfig/configproto.h @@ -87,6 +87,7 @@ private: int SendDataAnswer(int sock, const std::string & answer); int SendError(int sock, const std::string & text); void WriteLogAccessFailed(uint32_t ip); + const std::string & GetDataAnswer() const { return dataAnswer; } int ParseCommand(); @@ -100,6 +101,7 @@ private: int state; ADMIN * currAdmin; PLUGIN_LOGGER & logger; + std::string dataAnswer; int listenSocket;