1 #ifndef __FCGIPLUS_HPP__ 2 #define __FCGIPLUS_HPP__ 5 #pragma warning( disable: 4244 ) 17 #ifdef FCGIPLUS_DLL_USE 18 #if defined(_MSC_VER) || defined(WIN32) 19 #pragma warning( disable: 4251 ) 20 #ifdef FCGIPLUS_DLL_EXPORTS 21 #define FCGIPLUS_DLL __declspec(dllexport) 23 #define FCGIPLUS_DLL __declspec(dllimport) 26 #define FCGIPLUS_API __stdcall 36 #define FCGIPLUS_FUNC_DECL(ret) FCGIPLUS_DLL ret FCGIPLUS_API 37 #define FCGIPLUS_FUNC_IMPL(ret) ret FCGIPLUS_API 70 virtual void clean() = 0;
72 virtual bool startup(
winux::String const & sessid, SessionData * sessData ) = 0;
85 typedef std::map<winux::String, SessionStruct> SessionStructMap;
86 SessionStructMap _sessions;
90 virtual bool startup(
winux::String const & sessid, SessionData * sessData );
101 virtual void clean();
102 virtual bool startup(
winux::String const & sessid, SessionData * sessData );
146 void init(
FcgiApp * app,
int sock,
int flags );
149 void free(
bool close =
false );
170 void dumpEnvTo(
winux::String * str,
char * * envp = NULL )
const;
200 void _redirectToFcgi();
203 int _tryEncodingConvert();
206 bool _isNeedEncodingConvert()
const;
210 FcgiOutputMgr(
struct FCGX_Stream * fcgiOut,
struct FCGX_Stream * fcgiErr );
233 void write(
void const *
data,
int size );
234 void printf(
char const * format, va_list va );
251 bool _autoContentType;
260 void write(
void const *
data,
int size );
262 void printf(
char const * format, ... );
291 void import(
winux::String const & doFile,
void * runParam = NULL,
int * retCode = NULL );
309 int run(
void * runParam );
313 template <
typename _Ty >
314 _Ty
getParam()
const {
return reinterpret_cast<_Ty
>(_param); };
317 void setParam(
void * param ) { this->_param = param; }
321 template <
typename _Ty >
322 _Ty
getRunParam()
const {
return reinterpret_cast<_Ty
>(_runParam); };
394 ConfigParams() : isProduction(false), maxUrlencodedPostSize(0), maxMultiFormPostSize(0)
421 #endif // __FCGIPLUS_HPP__
winux::StringStringMap environVars
环境变量
http::Vars post
POST变量 readonly.
void setParam(void *param)
设置do传递参数
winux::uint getCleanTimeInterval() const
struct FcgiServerData * getServerData()
取得服务器相关数据
void setAutoContentType(bool autoContentType=true)
是否自动设置Content-Type
std::map< String, Mixed > StringMixedMap
Request & req
Request对象的引用
FcgiApp * fcgiApp
FcgiApp对象指针
SessionServer * getSessServ()
取得/设置SessionServer
winux::String convFrom(winux::String const &str) const
winux::uint _sessionLifeTime
默认session生命期
std::map< String, String > StringStringMap
winux::StringMixedMap SessionData
会话数据
bool isProduction
isProduction指示是否以产品级模式运行.
http::Header & header
表示头部
void setCharset(winux::String const &charset)
设置charset,即设置输出目标编码
#define DISABLE_OBJECT_COPY(clsname)
winux::String getMimeType() const
http::Cookies cookies
Cookie变量 read/write.
winux::String outputTplPath
获取已经从配置文件中加载的【输出模板的路径】
winux::String uploadTmpPath
上传文件的临时目录
winux::Configure & config
配置
void setSessServ(SessionServer *sessServ)
缓冲区,表示内存中一块二进制数据(利用malloc/realloc进行内存分配)
void setMimeType(winux::String const &mime)
设置mime
winux::String getCharset() const
void * getParam() const
取得do传递的参数
winux::int64 maxMultiFormPostSize
当请求的Content-Type是multipart/form-data时,多部分表单POST发送数据的最大大小
void setTargetEncoding(winux::String const &target)
指定目标编码(Response不会自动设置)
winux::String convFrom(winux::String const &str) const
目标编码转到本地编码
winux::String getLocalEncoding() const
winux::String getLocalEncoding() const
winux::uint getSessionLifeTime() const
winux::String convTo(winux::String const &str) const
winux::String getTargetEncoding() const
winux::int64 maxUrlencodedPostSize
当请求的Content-Type是application/x-www-form-urlencoded时,表单POST发送数据的最大大小 ...
winux::String convTo(winux::String const &str) const
本地编码转到目标编码
winux::uint _cleanTimeInterval
执行"清理过期session"的时间间隔
void setServerData(struct FcgiServerData *data)
void * getRunParam() const
取得run()传递的参数
winux::String getTargetEncoding() const