lots of log message and fixed bad_file_descriptor issue
This commit is contained in:
@@ -34,9 +34,12 @@ void Webserv::_handle_epollerr_cgi_output(uint32_t events, Client *client)
|
||||
if (wait_ret == client->cgi_pid)
|
||||
{
|
||||
_epoll_update(client->cgi_pipe_r_from_child, 0, EPOLL_CTL_DEL);
|
||||
|
||||
std::cerr << family << "| (" << std::setw(2) << client->get_cl_fd() << ") close pipe rfc [" << client->cgi_pipe_r_from_child << "]\n";
|
||||
if (::close(client->cgi_pipe_r_from_child) == -1)
|
||||
std::perror("err close()");
|
||||
client->cgi_pipe_r_from_child = -1;
|
||||
|
||||
_epoll_update(client->get_cl_fd(), EPOLLOUT, EPOLL_CTL_ADD);
|
||||
}
|
||||
|
||||
@@ -52,9 +55,12 @@ void Webserv::_handle_epollhup_cgi_output(uint32_t events, Client *client)
|
||||
if (wait_ret == client->cgi_pid)
|
||||
{
|
||||
_epoll_update(client->cgi_pipe_r_from_child, 0, EPOLL_CTL_DEL);
|
||||
|
||||
std::cerr << family << "| (" << std::setw(2) << client->get_cl_fd() << ") close pipe rfc [" << client->cgi_pipe_r_from_child << "]\n";
|
||||
if (::close(client->cgi_pipe_r_from_child) == -1)
|
||||
std::perror("err close()");
|
||||
client->cgi_pipe_r_from_child = -1;
|
||||
|
||||
_epoll_update(client->get_cl_fd(), EPOLLOUT, EPOLL_CTL_ADD);
|
||||
client->cgi_state = CGI_OUTPUT_COMPLETE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user