diff --git a/core/pluginmsg.h b/core/pluginmsg.h index fa0b66f..4fd0c7c 100755 --- a/core/pluginmsg.h +++ b/core/pluginmsg.h @@ -242,9 +242,15 @@ // this is sent only from PostParser // PostMultiParser (multipart/form-data html forms) doesn't send this messsage // there is no a session set (session pointer is null) +// this message is sent for each name value pairs +// #define WINIX_POST_PARAMS 31040 +// this is the raw string sent in POST method +// in p1 there is a pointer to std::string object +#define WINIX_RAW_POST_STRING 31040 + /* messages sent from other threads diff --git a/core/postparser.h b/core/postparser.h index fc6ab04..b9198ff 100755 --- a/core/postparser.h +++ b/core/postparser.h @@ -32,7 +32,8 @@ class PostParser : public HttpSimpleParser size_t log_value_size; int var_index; bool has_winix_post_params_msg; - + bool has_winix_raw_post_msg; + std::string raw_post; protected: @@ -40,7 +41,12 @@ protected: virtual int GetChar() { - return FCGX_GetChar(in); + int c = FCGX_GetChar(in); + + if( c != -1 && has_winix_raw_post_msg ) + raw_post += c; + + return c; } @@ -111,7 +117,6 @@ public: log_value_size = 0; } - void UTF8(bool utf) { input_as_utf8 = utf; @@ -127,10 +132,17 @@ public: in = in_; post_tab = &post_tab_; var_index = 1; + raw_post.clear(); has_winix_post_params_msg = plugin.HasMessage(WINIX_POST_PARAMS); + has_winix_raw_post_msg = plugin.HasMessage(WINIX_RAW_POST_STRING); HttpSimpleParser::Parse(); + + if( has_winix_raw_post_msg ) + plugin.Call(0, WINIX_RAW_POST_STRING, &raw_post); + + raw_post.clear(); } };