What does the "char **envp;" of FCGX_Request mean in FastCGI?
In FastCGI, there is a pointer, envp, of struct FCGX_Request. Here is the code :
typedef struct FCGX_Request {
int requestId; /* valid if isBeginProcessed */
int role;
FCGX_Stream *in;
FCGX_Stream *out;
FCGX_Stream *err;
char **envp;
/* Don't use anything below here */
struct Params *paramsPtr;
int ipcFd; /* < 0 means no connection */
int isBeginProcessed; /* FCGI_BEGIN_REQUEST seen */
int keepConnection; /* don't close ipcFd at end of request */
int appStatus;
int nWriters; /* number of open writers (0..2) */
int flags;
int listen_sock;
} FCGX_Request;
I guess it means the environment variable of somewhere. Is the browser's or the webserver's environment variable?
Maybe I know little about the WEB, but I guess this should be something abou开发者_如何学JAVAt the transmission between the browser and the webserver. So the envp is sent by the broswer to the webserver? If that's true, can anybody show me some details about the envrioment variable?
What's more, with FCGX_Request::in I can get some POST or GET actions, which is submitted by the browser. And I can put the result into FCGX_Request::out to sent to the browser. My question is, is there any other things I can learn?
Any link of keyword is welcome. thanks~
I guess it means the environment variable of somewhere. Is the browser's or the webserver's environment variable?
It's a pointer to an array of string pointers containing the environment variables passed by client (webserver) to the server (application), it's used internally by FCGX_GetParam()
. You can use it if you want to iterate through all variables but you should not mutate it or retain any pointers past the end of request.
... I guess this should be something about the transmission between the browser and the webserver. So the envp is sent by the broswer to the webserver? If that's true, can anybody show me some details about the envrioment variable?
The browser uses the HTTP to talk with the webserver. The webserver uses FastCGI protocol and CGI to interface your application.
The envp contains specific CGI and HTTP variables as defined by the standard, RFC 3875.
My question is, is there any other things I can learn?
Knowledge about mentioned protocols would probably be good start. The FastCGI dev kit's documentation and examples. fcgiapp.h
contains documentation for most public functions.
精彩评论