added timeout response (status 408)
+ added EPOLLERR and EPOLLHUP handling + fix root substitution for default "/" location (temp or permanent ?) + tested siege a little, seems good
This commit is contained in:
@@ -49,7 +49,7 @@ void Webserv::init_virtual_servers(std::vector<ServerConfig>* servers)
|
||||
// HUGO ADD END
|
||||
|
||||
_bind(new_socket.fd, std::atoi(it->port.c_str()), it->host);
|
||||
_listen(new_socket.fd, 512); // 512 arbitrary
|
||||
_listen(new_socket.fd, 42); // 42 arbitrary
|
||||
|
||||
if (_epoll_update(new_socket.fd, EPOLLIN, EPOLL_CTL_ADD) == -1)
|
||||
throw std::runtime_error("Socket init");
|
||||
@@ -89,7 +89,7 @@ void Webserv::_listen(int socket_fd, unsigned int max_connections)
|
||||
|
||||
void Webserv::_init_http_status_map()
|
||||
{
|
||||
/* "map.insert()" over "map.operator[]" :
|
||||
/* "map.insert()" more appropriate than "map.operator[]" :
|
||||
** http://www.uml.org.cn/c%2B%2B/pdf/EffectiveSTL.pdf#page=93
|
||||
*/
|
||||
typedef std::map<int, std::string>::value_type status_pair;
|
||||
@@ -110,6 +110,7 @@ void Webserv::_init_http_status_map()
|
||||
_http_status.insert(status_pair(403, S403));
|
||||
_http_status.insert(status_pair(404, S404));
|
||||
_http_status.insert(status_pair(405, S405));
|
||||
_http_status.insert(status_pair(408, S408));
|
||||
_http_status.insert(status_pair(413, S413));
|
||||
|
||||
_http_status.insert(status_pair(500, S500));
|
||||
|
||||
Reference in New Issue
Block a user