Review parsing Eric and Luke.

Combined the config parser with Webserv class.
This commit is contained in:
LuckyLaszlo
2022-07-31 00:27:48 +02:00
parent 2d91b704c3
commit e5c2869172
10 changed files with 76 additions and 391 deletions

View File

@@ -34,7 +34,9 @@ void Webserv::run()
while (i < nfds)
{
// if ((events[i].data.u32 == SERVER_FD) && (events[i].events & EPOLLIN)) // Dont work, see "SERVER_FD" define
if ((events[i].data.fd == _socket_fd) && (events[i].events & EPOLLIN))
// if ((events[i].data.fd == _socket_fd) && (events[i].events & EPOLLIN))
if ((std::find(_listen_sockets.begin(), _listen_sockets.end(), events[i].data.fd) != _listen_sockets.end())
&& (events[i].events & EPOLLIN))
_accept_connection(events[i].data.fd);
else if (events[i].events & EPOLLIN)
_request(static_cast<Client*>(events[i].data.ptr));