53#if defined (c_plusplus) || defined (__cplusplus)
72#define LSAPI_MAX_RESP_HEADERS 1000
136 const char * pValue,
int valLen,
void *
arg );
191 const char * pHeaderValue );
194 const char * pBody,
int bodyLen );
196static inline int LSAPI_SetRespStatus_r(
LSAPI_Request * pReq,
int code )
212static inline void * LSAPI_GetAppData_r(
LSAPI_Request * pReq )
219static inline char * LSAPI_GetQueryString_r(
LSAPI_Request * pReq )
227static inline char * LSAPI_GetScriptFileName_r(
LSAPI_Request * pReq )
235static inline char * LSAPI_GetScriptName_r(
LSAPI_Request * pReq )
243static inline char * LSAPI_GetRequestMethod_r(
LSAPI_Request * pReq)
252static inline off_t LSAPI_GetReqBodyLen_r(
LSAPI_Request * pReq )
259static inline off_t LSAPI_GetReqBodyRemain_r(
LSAPI_Request * pReq )
273static inline int LSAPI_Accept(
void )
276static inline int LSAPI_Finish(
void)
279static inline char * LSAPI_GetHeader(
int headerIndex )
285static inline int LSAPI_ForeachOrgHeader(
295static inline char * LSAPI_GetEnv(
const char *
name )
298static inline char * LSAPI_GetQueryString(
void)
299{
return LSAPI_GetQueryString_r( &
g_req ); }
301static inline char * LSAPI_GetScriptFileName(
void)
302{
return LSAPI_GetScriptFileName_r( &
g_req ); }
304static inline char * LSAPI_GetScriptName(
void)
305{
return LSAPI_GetScriptName_r( &
g_req ); }
307static inline char * LSAPI_GetRequestMethod(
void)
308{
return LSAPI_GetRequestMethod_r( &
g_req ); }
310static inline off_t LSAPI_GetReqBodyLen(
void)
311{
return LSAPI_GetReqBodyLen_r( &
g_req ); }
313static inline off_t LSAPI_GetReqBodyRemain(
void)
314{
return LSAPI_GetReqBodyRemain_r( &
g_req ); }
316static inline ssize_t LSAPI_ReadReqBody(
char * pBuf,
size_t len )
319static inline int LSAPI_ReqBodyGetChar(
void)
322static inline int LSAPI_ReqBodyGetLine(
char * pBuf,
int len,
int *getLF )
327static inline int LSAPI_FinalizeRespHeaders(
void)
330static inline ssize_t LSAPI_Write(
const char * pBuf, ssize_t
len )
333static inline ssize_t LSAPI_sendfile(
int fdIn, off_t* off,
size_t size )
338static inline ssize_t LSAPI_Write_Stderr(
const char * pBuf, ssize_t
len )
341static inline int LSAPI_Flush(
void)
344static inline int LSAPI_AppendRespHeader(
char * pBuf,
int len )
347static inline int LSAPI_SetRespStatus(
int code )
348{
return LSAPI_SetRespStatus_r( &
g_req, code ); }
350static inline int LSAPI_ErrResponse(
int code,
const char ** pRespHeaders,
const char * pBody,
int bodyLen )
353static inline int LSAPI_End_Response(
void)
360typedef int (*
fn_select_t)( int, fd_set *, fd_set *, fd_set *,
struct timeval * );
403#define LSAPI_LOG_LEVEL_BITS 0xff
404#define LSAPI_LOG_FLAG_NONE 0
405#define LSAPI_LOG_FLAG_DEBUG 1
406#define LSAPI_LOG_FLAG_INFO 2
407#define LSAPI_LOG_FLAG_NOTICE 3
408#define LSAPI_LOG_FLAG_WARN 4
409#define LSAPI_LOG_FLAG_ERROR 5
410#define LSAPI_LOG_FLAG_CRIT 6
411#define LSAPI_LOG_FLAG_FATAL 7
413#define LSAPI_LOG_TIMESTAMP_BITS (0xff00)
414#define LSAPI_LOG_TIMESTAMP_FULL (0x100)
415#define LSAPI_LOG_TIMESTAMP_HMS (0x200)
416#define LSAPI_LOG_TIMESTAMP_STDERR (0x400)
418#define LSAPI_LOG_PID (0x10000)
420void LSAPI_Log(
int flag,
const char * fmt, ...)
427#if defined (c_plusplus) || defined (__cplusplus)
printf(string $format, mixed ... $values)
int LSAPI_ForeachSpecialEnv_r(LSAPI_Request *pReq, LSAPI_CB_EnvHandler fn, void *arg)
void LSAPI_Register_Pgrp_Timer_Callback(LSAPI_On_Timer_pf)
char * LSAPI_GetEnv_r(LSAPI_Request *pReq, const char *name)
ssize_t LSAPI_Write_Stderr_r(LSAPI_Request *pReq, const char *pBuf, size_t len)
int LSAPI_ForeachOrgHeader_r(LSAPI_Request *pReq, LSAPI_CB_EnvHandler fn, void *arg)
int LSAPI_Accept_r(LSAPI_Request *pReq)
int LSAPI_Release_r(LSAPI_Request *pReq)
int LSAPI_AppendRespHeader_r(LSAPI_Request *pReq, const char *pBuf, int len)
#define LSAPI_MAX_RESP_HEADERS
int LSAPI_Is_Listen(void)
int(* LSAPI_CB_EnvHandler)(const char *pKey, int keyLen, const char *pValue, int valLen, void *arg)
void LSAPI_Set_Max_Reqs(int reqs)
int LSAPI_Init_Env_Parameters(fn_select_t fp)
int LSAPI_Set_Restored_Parent_Pid(int pid)
void LSAPI_Set_Server_Max_Idle_Secs(int serverMaxIdle)
int LSAPI_Init_Prefork_Server(int max_children, fn_select_t fp, int avoidFork)
int LSAPI_ReqBodyGetLine_r(LSAPI_Request *pReq, char *pBuf, size_t bufLen, int *getLF)
ssize_t LSAPI_sendfile_r(LSAPI_Request *pReq, int fdIn, off_t *off, size_t size)
void LSAPI_Set_Max_Idle_Children(int maxIdleChld)
struct lsapi_request LSAPI_Request
int LSAPI_IsRunning(void)
int LSAPI_ForeachHeader_r(LSAPI_Request *pReq, LSAPI_CB_EnvHandler fn, void *arg)
int LSAPI_is_suEXEC_Daemon(void)
int LSAPI_Postfork_Child(LSAPI_Request *pReq)
void(* LSAPI_On_Timer_pf)(int *forked_child_pid)
int LSAPI_Finish_r(LSAPI_Request *pReq)
int(* fn_select_t)(int, fd_set *, fd_set *, fd_set *, struct timeval *)
int LSAPI_Postfork_Parent(LSAPI_Request *pReq)
int LSAPI_ErrResponse_r(LSAPI_Request *pReq, int code, const char **pRespHeaders, const char *pBody, int bodyLen)
void LSAPI_No_Check_ppid(void)
void LSAPI_Set_Max_Children(int maxChildren)
int LSAPI_Inc_Req_Processed(int cnt)
void LSAPI_Set_Slow_Req_Msecs(int msecs)
int LSAPI_ReqBodyGetChar_r(LSAPI_Request *pReq)
void LSAPI_Log(int flag, const char *fmt,...)
int LSAPI_FinalizeRespHeaders_r(LSAPI_Request *pReq)
int LSAPI_Is_Listen_r(LSAPI_Request *pReq)
int LSAPI_AppendRespHeader2_r(LSAPI_Request *pReq, const char *pHeaderName, const char *pHeaderValue)
int LSAPI_Prefork_Accept_r(LSAPI_Request *pReq)
int LSAPI_CreateListenSock(const char *pBind, int backlog)
int LSAPI_Get_Slow_Req_Msecs(void)
int LSAPI_InitRequest(LSAPI_Request *pReq, int fd)
void LSAPI_Set_Max_Idle(int secs)
void LSAPI_Set_Max_Process_Time(int secs)
void LSAPI_Set_Server_fd(int fd)
int LSAPI_ForeachEnv_r(LSAPI_Request *pReq, LSAPI_CB_EnvHandler fn, void *arg)
char * LSAPI_GetHeader_r(LSAPI_Request *pReq, int headerIndex)
ssize_t LSAPI_Write_r(LSAPI_Request *pReq, const char *pBuf, size_t len)
int LSAPI_Flush_r(LSAPI_Request *pReq)
void LSAPI_Reset_r(LSAPI_Request *pReq)
ssize_t LSAPI_ReadReqBody_r(LSAPI_Request *pReq, char *pBuf, size_t len)
int LSAPI_Accept_Before_Fork(LSAPI_Request *pReq)
int LSAPI_End_Response_r(LSAPI_Request *pReq)
struct lsapi_req_header * m_pHeader
short m_respHeaderLen[LSAPI_MAX_RESP_HEADERS]
struct iovec * m_pIovecCur
struct lsapi_child_status * child_status
struct iovec * m_pIovecToWrite
struct iovec * m_pIovecEnd
char * m_pRespHeaderBufPos
struct lsapi_resp_header m_respHeader
struct lsapi_http_header_index * m_pHeaderIndex
struct lsapi_packet_header * m_respPktHeaderEnd
struct lsapi_packet_header m_respPktHeader[5]
struct LSAPI_key_value_pair * m_pSpecialEnvList
struct LSAPI_key_value_pair * m_pEnvList
char * m_pRespHeaderBufEnd
struct lsapi_header_offset * m_pUnknownHeader
ZEND_API void(ZEND_FASTCALL *zend_touch_vm_stack_data)(void *vm_stack_data)