_exec_script() close fd and reset signal
+ somes more adjustements in _exec_script() + rough notes for non blocking CGI
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user