Webserv
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | Friends
Client Class Reference

#include <Client.hpp>

Collaboration diagram for Client:
Collaboration graph
[legend]

Public Member Functions

 Client (int fd, ip_port_t ip_port, Master *parent)
 
 ~Client (void)
 
bool getRequest (Env *env, string paquet)
 
void handleRequest (void)
 

Private Member Functions

void init (void)
 
bool getBody (string paquet)
 
bool parseHeader (Env *env)
 
string header_pick (string key, size_t id)
 
bool check_method (void)
 
void create_file (string path)
 
void cgi (string cgi_path, string path)
 
void send_redir (int redir_code, string opt)
 
void send_error (int error_code)
 
void send_answer (string msg)
 
void debug_header (void)
 

Private Attributes

int _fd
 
ip_port_t _ip_port
 
Master_parent
 
Server_server
 
Env_env
 
Route_route
 
string _method
 
string _uri
 
string _query
 
string _host
 
string _header
 
string _body
 
int _len
 
bool _last_chunk
 
std::map< string, vec_string_request
 

Friends

class Master
 

Detailed Description

Definition at line 4 of file Client.hpp.

Constructor & Destructor Documentation

◆ Client()

Client::Client ( int  fd,
ip_port_t  ip_port,
Master parent 
)

Definition at line 18 of file Client.cpp.

Here is the call graph for this function:

◆ ~Client()

Client::~Client ( void  )

Definition at line 23 of file Client.cpp.

Member Function Documentation

◆ cgi()

void Client::cgi ( string  cgi_path,
string  path 
)
private

Definition at line 178 of file Client.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_method()

bool Client::check_method ( void  )
private

Definition at line 123 of file Client.cpp.

Here is the caller graph for this function:

◆ create_file()

void Client::create_file ( string  path)
private

Definition at line 167 of file Client.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ debug_header()

void Client::debug_header ( void  )
private

Definition at line 11 of file debug.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getBody()

bool Client::getBody ( string  paquet)
private

Definition at line 58 of file Client.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRequest()

bool Client::getRequest ( Env env,
string  paquet 
)

Definition at line 37 of file Client.cpp.

Here is the call graph for this function:

◆ handleRequest()

void Client::handleRequest ( void  )

Definition at line 133 of file Client.cpp.

Here is the call graph for this function:

◆ header_pick()

string Client::header_pick ( string  key,
size_t  id 
)
private

Definition at line 121 of file Client.cpp.

Here is the caller graph for this function:

◆ init()

void Client::init ( void  )
private

Definition at line 28 of file Client.cpp.

Here is the caller graph for this function:

◆ parseHeader()

bool Client::parseHeader ( Env env)
private

Definition at line 79 of file Client.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_answer()

void Client::send_answer ( string  msg)
private

Definition at line 236 of file Client.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_error()

void Client::send_error ( int  error_code)
private

Definition at line 219 of file Client.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_redir()

void Client::send_redir ( int  redir_code,
string  opt 
)
private

Definition at line 212 of file Client.cpp.

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ Master

friend class Master
friend

Definition at line 37 of file Client.hpp.

Field Documentation

◆ _body

string Client::_body
private

Definition at line 11 of file Client.hpp.

◆ _env

Env* Client::_env
private

Definition at line 9 of file Client.hpp.

◆ _fd

int Client::_fd
private

Definition at line 5 of file Client.hpp.

◆ _header

string Client::_header
private

Definition at line 11 of file Client.hpp.

◆ _host

string Client::_host
private

Definition at line 11 of file Client.hpp.

◆ _ip_port

ip_port_t Client::_ip_port
private

Definition at line 6 of file Client.hpp.

◆ _last_chunk

bool Client::_last_chunk
private

Definition at line 13 of file Client.hpp.

◆ _len

int Client::_len
private

Definition at line 12 of file Client.hpp.

◆ _method

string Client::_method
private

Definition at line 11 of file Client.hpp.

◆ _parent

Master* Client::_parent
private

Definition at line 7 of file Client.hpp.

◆ _query

string Client::_query
private

Definition at line 11 of file Client.hpp.

◆ _request

std::map<string, vec_string> Client::_request
private

Definition at line 14 of file Client.hpp.

◆ _route

Route* Client::_route
private

Definition at line 10 of file Client.hpp.

◆ _server

Server* Client::_server
private

Definition at line 8 of file Client.hpp.

◆ _uri

string Client::_uri
private

Definition at line 11 of file Client.hpp.


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