added: WINIX_RAW_POST_STRING plugin message

this is the raw string sent in POST method (in p1 pointer there is a pointer to std::string object)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@875 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
Tomasz Sowa 2012-08-19 14:24:24 +00:00
parent 90261b2005
commit 54480da405
2 changed files with 21 additions and 3 deletions

View File

@ -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

View File

@ -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();
}
};