From: Maxim Mamontov Date: Sat, 13 Sep 2014 22:01:14 +0000 (+0300) Subject: Store parser answer in configproto. X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/95fbaf3fe639c84d7aab1d8c25cecdb9f8e7072a?hp=d0fdbc23533fdf51ff2474fadc1fc504ecd4a1dc Store parser answer in configproto. --- diff --git a/projects/stargazer/plugins/configuration/sgconfig/configproto.cpp b/projects/stargazer/plugins/configuration/sgconfig/configproto.cpp index a5ffcf5b..84e57bb2 100644 --- a/projects/stargazer/plugins/configuration/sgconfig/configproto.cpp +++ b/projects/stargazer/plugins/configuration/sgconfig/configproto.cpp @@ -78,6 +78,7 @@ if (cp->currParser) { if (cp->currParser->ParseEnd(data, el) == 0) { + cp->dataAnswer = cp->currParser->GetAnswer(); cp->currParser = NULL; } } @@ -87,6 +88,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 623254ac..b50b434a 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;