]> git.stg.codes - stg.git/commitdiff
Store parser answer in configproto.
authorMaxim Mamontov <faust.madf@gmail.com>
Sat, 13 Sep 2014 22:01:14 +0000 (01:01 +0300)
committerMaxim Mamontov <faust.madf@gmail.com>
Sat, 13 Sep 2014 22:01:14 +0000 (01:01 +0300)
projects/stargazer/plugins/configuration/sgconfig/configproto.cpp
projects/stargazer/plugins/configuration/sgconfig/configproto.h

index a5ffcf5b3c5d4a4828d26245cd3e117c6c5a1be6..84e57bb2a2fe4eed4f561518fa550df498cdfd26 100644 (file)
@@ -78,6 +78,7 @@ if (cp->currParser)
     {
     if (cp->currParser->ParseEnd(data, el) == 0)
         {
     {
     if (cp->currParser->ParseEnd(data, el) == 0)
         {
+        cp->dataAnswer = cp->currParser->GetAnswer();
         cp->currParser = NULL;
         }
     }
         cp->currParser = NULL;
         }
     }
@@ -87,6 +88,8 @@ else
         {
         if (cp->dataParser[i]->ParseEnd(data, el) == 0)
             {
         {
         if (cp->dataParser[i]->ParseEnd(data, el) == 0)
             {
+            cp->dataAnswer = cp->currParser->GetAnswer();
+            cp->currParser = NULL;
             break;
             }
         }
             break;
             }
         }
index 623254ac1a0eee515d0e1e07a81efe4383a11253..b50b434aa80993bedf15830888b6dde8ab5daf80 100644 (file)
@@ -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);
     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();
 
 
     int             ParseCommand();
 
@@ -100,6 +101,7 @@ private:
     int                         state;
     ADMIN *                     currAdmin;
     PLUGIN_LOGGER &             logger;
     int                         state;
     ADMIN *                     currAdmin;
     PLUGIN_LOGGER &             logger;
+    std::string                 dataAnswer;
 
     int                         listenSocket;
 
 
     int                         listenSocket;