Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

FastCgi Class Reference

Inheritance diagram for FastCgi:

HttpDataHandler List of all members.

Public Member Functions

 FastCgi ()
int send (HttpThreadContext *td, ConnectionPtr connection, const char *scriptpath, const char *cgipath, int execute, int onlyHeader)

Static Public Member Functions

int getInitialPort ()
int getMaxFcgiServers ()
int getTimeout ()
int load (XmlParser *)
void setInitialPort (int)
void setMaxFcgiServers (int)
void setTimeout (int)
int unload ()

Private Member Functions

int buildFASTCGIEnvironmentString (HttpThreadContext *, char *, char *)
FastCgiServersListfcgiConnect (FcgiContext *, const char *)
int fcgiConnectSocket (FcgiContext *, FastCgiServersList *)
void generateFcgiHeader (FcgiHeader &, int,int, int)
Socket getFcgiConnection ()
FastCgiServersListisFcgiServerRunning (const char *)
bool isRemoteServer (const char *)
FastCgiServersListrunFcgiServer (FcgiContext *, const char *)
int runLocalServer (FastCgiServersList *server, const char *path, int port)
int sendFcgiBody (FcgiContext *con, char *buffer, int len, int type, int id)

Static Private Attributes

int initialized = 0
int initialPort = 3333
int maxFcgiServers = 25
HashMap< string, FastCgiServersList * > serversList
Mutex serversMutex
int timeout = MYSERVER_SEC(15)

Constructor & Destructor Documentation

FastCgi::FastCgi  ) 
 

Constructor for the FASTCGI class


Member Function Documentation

int FastCgi::buildFASTCGIEnvironmentString HttpThreadContext ,
char *  sp,
char *  ep
[private]
 

Trasform from a standard environment string to the FastCGI environment string.

FastCgiServersList * FastCgi::fcgiConnect FcgiContext con,
const char *  path
[private]
 

Get a connection to the FastCGI server.

int FastCgi::fcgiConnectSocket FcgiContext con,
FastCgiServersList server
[private]
 

Get a client socket in the fCGI context structure

void FastCgi::generateFcgiHeader FcgiHeader header,
int  iType,
int  iRequestId,
int  iContentLength
[private]
 

Fill the FcgiHeader structure.

Socket FastCgi::getFcgiConnection  )  [private]
 

int FastCgi::getInitialPort  )  [static]
 

Get the initial port.

int FastCgi::getMaxFcgiServers  )  [static]
 

Get the max number of servers that can be executed.

int FastCgi::getTimeout  )  [static]
 

Return the timeout value.

FastCgiServersList * FastCgi::isFcgiServerRunning const char *  path  )  [private]
 

Return the the running server specified by path. If the server is not running returns 0.

bool FastCgi::isRemoteServer const char *  location  )  [private]
 

Return if the location is a remote one. A remote location starts with a @.

Parameters:
location The location to check.

int FastCgi::load XmlParser  )  [static]
 

Initialize the FastCGI protocol implementation

Reimplemented from HttpDataHandler.

FastCgiServersList * FastCgi::runFcgiServer FcgiContext context,
const char *  path
[private]
 

Run the FastCGI server. If the path starts with a @ character, the path is handled as a remote server.

int FastCgi::runLocalServer FastCgiServersList server,
const char *  path,
int  port
[private]
 

Start the server on the specified port. Return zero on success.

int FastCgi::send HttpThreadContext td,
ConnectionPtr  connection,
const char *  scriptpath,
const char *  cgipath,
int  execute,
int  onlyHeader
 

Entry-Point to manage a FastCGI request.

int FastCgi::sendFcgiBody FcgiContext con,
char *  buffer,
int  len,
int  type,
int  id
[private]
 

Send the buffer content over the FastCGI connection Return non-zero on errors.

void FastCgi::setInitialPort int  nport  )  [static]
 

Set the initial port for new servers.

void FastCgi::setMaxFcgiServers int  max  )  [static]
 

Set a new value for the max number of servers that can be executed.

void FastCgi::setTimeout int  ntimeout  )  [static]
 

Set a new timeout.

int FastCgi::unload  )  [static]
 

Clean the memory and the processes occuped by the FastCGI servers

Reimplemented from HttpDataHandler.


Member Data Documentation

int FastCgi::initialized = 0 [static, private]
 

Is the fastcgi initialized?

int FastCgi::initialPort = 3333 [static, private]
 

By default start binding ports from 3333.

int FastCgi::maxFcgiServers = 25 [static, private]
 

By default allows 25 servers.

HashMap< string, FastCgiServersList * > FastCgi::serversList [static, private]
 

Running servers.

Mutex FastCgi::serversMutex [static, private]
 

Mutex used to access fastCGI servers.

int FastCgi::timeout = MYSERVER_SEC(15) [static, private]
 

Use a default timeout of 15 seconds.


Generated on Wed Nov 8 13:12:48 2006 for MyServer by doxygen 1.3.6