2008-12-10 05:42:49 +01:00
|
|
|
/*
|
2010-02-28 01:08:10 +01:00
|
|
|
* This file is a part of Winix
|
2008-12-10 05:42:49 +01:00
|
|
|
* and is not publicly distributed
|
|
|
|
*
|
2010-02-28 22:33:06 +01:00
|
|
|
* Copyright (c) 2008-2010, Tomasz Sowa
|
2008-12-10 05:42:49 +01:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2009-04-21 22:50:55 +02:00
|
|
|
#ifndef headerfilecmslucorepostparser
|
|
|
|
#define headerfilecmslucorepostparser
|
2008-12-10 05:42:49 +01:00
|
|
|
|
|
|
|
#include <fcgiapp.h>
|
|
|
|
#include <string>
|
|
|
|
#include "httpsimpleparser.h"
|
|
|
|
#include "requesttypes.h"
|
|
|
|
|
|
|
|
|
2009-01-26 21:49:28 +01:00
|
|
|
|
|
|
|
|
2008-12-10 05:42:49 +01:00
|
|
|
class PostParser : public HttpSimpleParser
|
|
|
|
{
|
|
|
|
|
|
|
|
FCGX_Stream * in;
|
|
|
|
PostTable & post_table;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
|
|
virtual int GetChar()
|
|
|
|
{
|
|
|
|
return FCGX_GetChar(in);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
virtual void Parameter(std::string & name, std::string & value)
|
|
|
|
{
|
|
|
|
std::pair<PostTable::iterator, bool> res = post_table.insert( std::make_pair(name, value) );
|
|
|
|
|
|
|
|
log << log2 << "Method POST, name: \"" << name << "\", value: \"" << value << "\"";
|
|
|
|
|
|
|
|
if( res.second == false )
|
|
|
|
log << log2 << " (skipped)";
|
|
|
|
|
|
|
|
log << log2 << logend;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
PostParser(FCGX_Stream * in_, PostTable & post_table_) : in(in_), post_table(post_table_)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|