Webserv
|
#include <Server.hpp>
Public Member Functions | |
Server (JSONNode *server) | |
Constructor. | |
~Server (void) | |
Destructor. | |
Master * | create_master (string str) |
Master socket safe creation. | |
std::vector< Master * > | get_sockets (JSONNode *server) |
Create server's defined sockets: | |
Route * | choose_route (string uri) |
Choose the route an uri asked to the server. | |
string | getName (void) |
Public Member Functions inherited from Route | |
Route (Server *server, string location, JSONNode *datas) | |
Constructor. | |
~Route (void) | |
Destructor. | |
string | getLocation (void) |
string | getRoot (void) |
string | getReturn (void) |
Server * | getServer (void) |
string | getIndex (string uri, string path) |
Search for an index while generating autoindex. | |
string | correctUri (string uri) |
Find the local path corresponding to the uri asked by te client. | |
Data Fields | |
std::vector< ip_port_t > | _listens |
The list of listens the server which are linked to the server. | |
Data Fields inherited from Route | |
vec_string | _indexs |
vec_string | _allowed_methods |
std::map< string, string > | _cgi |
int | _client_max_body_size |
Private Attributes | |
string | _name |
The server name. | |
std::map< string, Route * > | _routes |
The server's routings with a route object as object and his location as key. | |
Additional Inherited Members | |
Protected Attributes inherited from Route | |
Server * | _server |
string | _location |
string | _root |
string | _ret |
bool | _autoindex |
Definition at line 4 of file Server.hpp.
Server::Server | ( | JSONNode * | server | ) |
Constructor.
The Route constructor scrap the routing informations (index, root, autoindex ...) and the Server one the others ones (server_name, sub-routes)
server | A server block JSONNode get by parser. |
Definition at line 20 of file Server.cpp.
Server::~Server | ( | void | ) |
Route * Server::choose_route | ( | string | uri | ) |
Choose the route an uri asked to the server.
uri | The uri asked by the client to the server. |
Definition at line 102 of file Server.cpp.
Master * Server::create_master | ( | string | str | ) |
Master socket safe creation.
str | a "ip:port" string |
Definition at line 56 of file Server.cpp.
Create server's defined sockets:
server | A server block node from JSONParser. |
@retrn A vector containing all the succesfull created sockets using listens from the server block.
Definition at line 79 of file Server.cpp.
string Server::getName | ( | void | ) |
Definition at line 47 of file Server.cpp.
std::vector<ip_port_t> Server::_listens |
The list of listens the server which are linked to the server.
Definition at line 9 of file Server.hpp.
|
private |
The server name.
Definition at line 5 of file Server.hpp.
|
private |
The server's routings with a route object as object and his location as key.
Definition at line 6 of file Server.hpp.