clean comment and stuff
This commit is contained in:
@@ -7,13 +7,8 @@ void Webserv::_read_cgi_output(Client *client)
|
||||
{
|
||||
char buf[BUFSIZE];
|
||||
ssize_t ret;
|
||||
std::cerr << "_read_cgi_output()" << "\n"; // Debug
|
||||
std::cerr << "cgi_pid = " << client->cgi_pid << "\n"; // Debug
|
||||
std::cerr << "client fd = " << client->get_cl_fd() << "\n"; // Debug
|
||||
std::cerr << "cgi fd = " << client->cgi_pipe_r_from_child << "\n"; // Debug
|
||||
|
||||
ret = ::read(client->cgi_pipe_r_from_child, buf, BUFSIZE);
|
||||
std::cerr << "cgi read ret = " << ret << "\n"; // Debug
|
||||
if (ret == -1)
|
||||
{
|
||||
std::perror("err read(cgi_fd)");
|
||||
@@ -29,10 +24,6 @@ void Webserv::_read_cgi_output(Client *client)
|
||||
void Webserv::_handle_epollerr_cgi_output(uint32_t events, Client *client)
|
||||
{
|
||||
(void)events;
|
||||
std::cerr << "cgi EPOLLERR" << "\n";
|
||||
std::cerr << "cgi_pid = " << client->cgi_pid << "\n";
|
||||
std::cerr << "client fd = " << client->get_cl_fd() << "\n";
|
||||
std::cerr << "cgi fd = " << client->cgi_pipe_r_from_child << "\n";
|
||||
|
||||
client->status = 500;
|
||||
client->cgi_state = CGI_NO_CGI;
|
||||
@@ -40,7 +31,6 @@ void Webserv::_handle_epollerr_cgi_output(uint32_t events, Client *client)
|
||||
// Common with EPOLLHUP
|
||||
pid_t wait_ret;
|
||||
wait_ret = ::waitpid(client->cgi_pid, NULL, WNOHANG);
|
||||
std::cerr << "cgi EPOLLERR waitpid ret = " << wait_ret << "\n";
|
||||
if (wait_ret == client->cgi_pid)
|
||||
{
|
||||
_epoll_update(client->cgi_pipe_r_from_child, 0, EPOLL_CTL_DEL);
|
||||
@@ -55,17 +45,10 @@ void Webserv::_handle_epollerr_cgi_output(uint32_t events, Client *client)
|
||||
void Webserv::_handle_epollhup_cgi_output(uint32_t events, Client *client)
|
||||
{
|
||||
(void)events;
|
||||
(void)client;
|
||||
|
||||
/* std::cerr << "cgi EPOLLHUP" << "\n";
|
||||
std::cerr << "cgi_pid = " << client->cgi_pid << "\n";
|
||||
std::cerr << "client fd = " << client->get_cl_fd() << "\n";
|
||||
std::cerr << "cgi fd = " << client->cgi_pipe_r_from_child << "\n"; */
|
||||
|
||||
// Common with EPOLLERR
|
||||
pid_t wait_ret;
|
||||
wait_ret = ::waitpid(client->cgi_pid, NULL, WNOHANG);
|
||||
// std::cerr << "cgi EPOLLHUP waitpid ret = " << wait_ret << "\n";
|
||||
if (wait_ret == client->cgi_pid)
|
||||
{
|
||||
_epoll_update(client->cgi_pipe_r_from_child, 0, EPOLL_CTL_DEL);
|
||||
|
||||
Reference in New Issue
Block a user