From bcd21b6aaa556a95a9d0b84b5f8328aadb5c3d3d Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Sun, 14 Sep 2014 01:01:14 +0300 Subject: [PATCH] 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 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; -- 2.43.2