_exec_script() close fd and reset signal

+ somes more adjustements in _exec_script()
+ rough notes for non blocking CGI
This commit is contained in:
LuckyLaszlo
2022-08-16 06:50:20 +02:00
parent 4602844f5a
commit ff443c80b1
5 changed files with 107 additions and 26 deletions

View File

@@ -21,13 +21,21 @@ void Webserv::_close_client(int fd)
void Webserv::_close_all_clients()
{
while (!_clients.empty())
_close_all_clients_fd();
_clients.clear();
}
void Webserv::_close_all_clients_fd()
{
std::vector<Client>::iterator it = _clients.begin();
std::vector<Client>::iterator it_end = _clients.end();
while (it != it_end)
{
// _epoll_update(_clients.back().fd, 0, EPOLL_CTL_DEL); // normalement superflu, DEBUG
std::cerr << "close fd " << _clients.back().get_cl_fd() << "\n";
if (::close(_clients.back().get_cl_fd()) == -1)
std::perror("err close()");
_clients.pop_back();
++it;
}
}