part II of rewriting
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@635 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -13,16 +13,10 @@
|
||||
#include <fcgiapp.h>
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
#include <iomanip>
|
||||
|
||||
#include "requesttypes.h"
|
||||
#include "session.h"
|
||||
#include "item.h"
|
||||
#include "error.h"
|
||||
#include "compress.h"
|
||||
#include "acceptencodingparser.h"
|
||||
#include "htmlfilter.h"
|
||||
#include "postmultiparser.h"
|
||||
#include "config.h"
|
||||
|
||||
|
||||
@@ -30,6 +24,8 @@
|
||||
class FunctionBase;
|
||||
|
||||
|
||||
|
||||
|
||||
struct Request
|
||||
{
|
||||
// request id
|
||||
@@ -42,8 +38,8 @@ struct Request
|
||||
FCGX_Stream * in, * out, * err;
|
||||
FCGX_ParamArray env; // defined as 'char **'
|
||||
|
||||
|
||||
enum Method { get, post, none } method;
|
||||
// !! moze pozbyc sie tego none?
|
||||
enum Method { get, post, head, none } method;
|
||||
enum Role { responder, authorizer } role;
|
||||
|
||||
// headers, page and debug
|
||||
@@ -86,7 +82,7 @@ struct Request
|
||||
// current file (if exists)
|
||||
Item item;
|
||||
|
||||
// winix function
|
||||
// current winix function
|
||||
// null if there is no a function
|
||||
FunctionBase * function;
|
||||
|
||||
@@ -111,16 +107,17 @@ struct Request
|
||||
// send as attachment (causing header: content-disposition: attachment)
|
||||
bool send_as_attachment;
|
||||
|
||||
|
||||
|
||||
|
||||
Request();
|
||||
void SetConfig(Config * pconfig);
|
||||
void Clear();
|
||||
|
||||
// for debugging
|
||||
void PrintGetTab();
|
||||
void PrintEnv();
|
||||
void PrintIn();
|
||||
|
||||
Request();
|
||||
void ClearPostFileTmp();
|
||||
void Clear();
|
||||
|
||||
void Init();
|
||||
|
||||
bool IsParam(const char * param_name);
|
||||
const std::string & ParamValue(const char * param_name); // returns empty string if there is no such a parameter
|
||||
@@ -129,61 +126,25 @@ struct Request
|
||||
void SetCookie(const char * name, long value, tm * expires = 0);
|
||||
|
||||
bool IsPostVar(const char * var);
|
||||
std::string * PostVar(const char * var); // it can return null when there is no such a post variable
|
||||
const std::string & PostVar(const char * var);
|
||||
bool PostVar(const char * var, std::string & result);
|
||||
bool AllPostVarEmpty(); // returning true if all post vars are empty
|
||||
|
||||
void ReadEnvVariables();
|
||||
void CheckMethod();
|
||||
void ReadParameters();
|
||||
void Read();
|
||||
void SendAll();
|
||||
//void SendNotify();
|
||||
|
||||
void SetConfig(Config * pconfig);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
Config * config;
|
||||
|
||||
enum Header
|
||||
{
|
||||
h_200,
|
||||
h_404,
|
||||
h_403
|
||||
};
|
||||
void ClearPostFileTmp();
|
||||
|
||||
|
||||
|
||||
void SendSessionCookie();
|
||||
void CheckIE();
|
||||
void CheckKonqueror();
|
||||
|
||||
void SendHeaders(bool compressing, Header header);
|
||||
void AddDebugInfo();
|
||||
void SendPage(bool compressing, const std::string & source_ref);
|
||||
|
||||
// used to set some env_* variables into it, when the server didn't set that variable
|
||||
// it contains '\0'
|
||||
// contains '\0'
|
||||
// used to set env_* pointers to the empty value
|
||||
const char char_empty;
|
||||
|
||||
// used in ParamValue(const char * param_name) when there is no such a param
|
||||
// used in ParamValue() and PostVar() when there is no such a param
|
||||
const std::string str_empty;
|
||||
|
||||
|
||||
PostMultiParser post_multi_parser;
|
||||
|
||||
const char * SetEnvVar(const char * var);
|
||||
void StandardLog();
|
||||
|
||||
Compress compress;
|
||||
AcceptEncodingParser accept_encoding_parser;
|
||||
HTMLFilter html_filter;
|
||||
|
||||
|
||||
// html after filtering
|
||||
std::string clean_html;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user