Webserv
Loading...
Searching...
No Matches
http::CGIHandler Class Reference

#include <CGIHandler.hpp>

Inheritance diagram for http::CGIHandler:
http::IHandler

Static Public Member Functions

static std::string formatHeaderName (std::string const &name)
static void handle (Request const &, Response &, MimeTypes const &)

Private Member Functions

 CGIHandler (Request const &req, Response &res)
void handle ()
void buildArgv ()
void buildEnvp ()
bool initPipes ()
void fork ()
int execve ()
void runChildProcess ()
void runParentProcess ()

Private Attributes

Request const & req_
Responseres_
std::vector< std::string > argv_
std::vector< std::string > envp_
int pipeFd_ [2]
int errorFd_ [2]
int pid_

Additional Inherited Members

Public Member Functions inherited from http::IHandler
virtual ~IHandler ()

Constructor & Destructor Documentation

◆ CGIHandler()

http::CGIHandler::CGIHandler ( Request const & req,
Response & res )
private

Member Function Documentation

◆ buildArgv()

void http::CGIHandler::buildArgv ( )
private

◆ buildEnvp()

void http::CGIHandler::buildEnvp ( )
private

◆ execve()

int http::CGIHandler::execve ( )
private

◆ fork()

void http::CGIHandler::fork ( )
private

◆ formatHeaderName()

std::string http::CGIHandler::formatHeaderName ( std::string const & name)
static

◆ handle() [1/2]

void http::CGIHandler::handle ( )
private

◆ handle() [2/2]

void http::CGIHandler::handle ( Request const & req,
Response & res,
MimeTypes const & mime )
static

◆ initPipes()

bool http::CGIHandler::initPipes ( )
private

◆ runChildProcess()

void http::CGIHandler::runChildProcess ( )
private

◆ runParentProcess()

void http::CGIHandler::runParentProcess ( )
private

Member Data Documentation

◆ argv_

std::vector<std::string> http::CGIHandler::argv_
private

◆ envp_

std::vector<std::string> http::CGIHandler::envp_
private

◆ errorFd_

int http::CGIHandler::errorFd_[2]
private

◆ pid_

int http::CGIHandler::pid_
private

◆ pipeFd_

int http::CGIHandler::pipeFd_[2]
private

◆ req_

Request const& http::CGIHandler::req_
private

◆ res_

Response& http::CGIHandler::res_
private

The documentation for this class was generated from the following files: