littles adjustements but still no solution to the main problem
This commit is contained in:
47
temp_memo_debug_fork.txt
Normal file
47
temp_memo_debug_fork.txt
Normal file
@@ -0,0 +1,47 @@
|
||||
|
||||
/*
|
||||
//// RECREATE EPOLL //
|
||||
std::cerr << "epfd from parent = " << _epfd << "\n";
|
||||
if (::close(_epfd) == -1)
|
||||
std::perror("err close");
|
||||
_epfd = ::epoll_create1(EPOLL_CLOEXEC); // (EPOLL_CLOEXEC) for CGI fork ?
|
||||
if (_epfd == -1)
|
||||
{
|
||||
std::perror("err epoll_create1()");
|
||||
}
|
||||
|
||||
std::vector<listen_socket>::iterator it_ls = _listen_sockets.begin();
|
||||
std::vector<listen_socket>::iterator it_ls_end = _listen_sockets.end();
|
||||
while (it_ls != it_ls_end)
|
||||
{
|
||||
_epoll_update(it_ls->fd, EPOLLIN, EPOLL_CTL_ADD);
|
||||
++it_ls;
|
||||
}
|
||||
|
||||
std::vector<Client>::iterator it = _clients.begin();
|
||||
std::vector<Client>::iterator it_end = _clients.end();
|
||||
while (it != it_end)
|
||||
{
|
||||
if (it->cgi_state == CGI_WAIT_TO_EXEC)
|
||||
_epoll_update(it->cgi_pipe_w_to_child, EPOLLOUT, EPOLL_CTL_ADD);
|
||||
else if (it->cgi_state == CGI_OUTPUT_READING)
|
||||
_epoll_update(it->cgi_pipe_r_from_child, EPOLLIN, EPOLL_CTL_ADD);
|
||||
else if (client->request_complete)
|
||||
_epoll_update(it->get_cl_fd(), EPOLLOUT, EPOLL_CTL_ADD);
|
||||
else
|
||||
_epoll_update(it->get_cl_fd(), EPOLLIN, EPOLL_CTL_ADD);
|
||||
++it;
|
||||
}
|
||||
//// */
|
||||
|
||||
|
||||
|
||||
//// DEBUG, MINIMAL ACTIONS //
|
||||
// ::sleep(1); // rescue team
|
||||
client->status = 442; // rescue_team
|
||||
_close_client_cgi_pipes(client);// rescue_team
|
||||
// _epoll_update(client->get_cl_fd(), EPOLLOUT, EPOLL_CTL_ADD); // rescue_team
|
||||
client->cgi_state = CGI_NO_CGI; // rescue_team
|
||||
return; // rescue_team
|
||||
////
|
||||
|
||||
Reference in New Issue
Block a user