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 67 virtual void clean() = 0;
69 virtual bool startup(
winux::String const & sessid, SessionData * sessData ) = 0;
87 virtual bool startup(
winux::String const & sessid, SessionData * sessData );
92 typedef std::map<winux::String, SessionStruct> SessionStructMap;
93 SessionStructMap _sessions;
102 virtual void clean();
103 virtual bool startup(
winux::String const & sessid, SessionData * sessData );
147 void init(
FcgiApp * app,
int sock,
int flags );
150 void free(
bool close =
false );
171 void dumpEnvTo(
winux::String * str,
char * * envp = NULL )
const;
201 FcgiOutputMgr(
struct FCGX_Stream * fcgiOut,
struct FCGX_Stream * fcgiErr );
224 void write(
void const *
data,
int size );
225 void printf(
char const * format, va_list va );
236 void _redirectToFcgi();
239 int _tryEncodingConvert();
242 bool _isNeedEncodingConvert()
const;
257 void write(
void const *
data,
int size );
259 void printf(
char const * format, ... );
288 void import(
winux::String const & doFile,
void * runParam = NULL,
int * retCode = NULL );
296 bool _autoContentType;
313 int run(
void * runParam );
317 template <
typename _Ty >
318 _Ty
getParam()
const {
return reinterpret_cast<_Ty
>(_param); };
321 void setParam(
void * param ) { this->_param = param; }
325 template <
typename _Ty >
326 _Ty
getRunParam()
const {
return reinterpret_cast<_Ty
>(_runParam); };
398 ConfigParams() : isProduction(false), maxUrlencodedPostSize(0), maxMultiFormPostSize(0)
425 #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.
变量类。可转为application/x-www-form-urlencoded类型字符串。可用于解析和设置get/post变量 ...
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发送数据的最大大小
winux::String getLocalEncoding() const
winux::uint getSessionLifeTime() const
winux::String convTo(winux::String const &str) const
winux::int64 maxUrlencodedPostSize
当请求的Content-Type是application/x-www-form-urlencoded时,表单POST发送数据的最大大小 ...
winux::uint _cleanTimeInterval
执行"清理过期session"的时间间隔
void setServerData(struct FcgiServerData *data)
void * getRunParam() const
取得run()传递的参数
winux::String getTargetEncoding() const