From 95fbaf3fe639c84d7aab1d8c25cecdb9f8e7072a Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Sun, 14 Sep 2014 01:01:14 +0300 Subject: [PATCH 1/1] Store parser answer in configproto. --- .../stargazer/plugins/configuration/sgconfig/configproto.cpp | 3 +++ .../stargazer/plugins/configuration/sgconfig/configproto.h | 2 ++ 2 files changed, 5 insertions(+) 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; -- 2.44.2