fixed CGI alloc

+ handle unknow status from script
This commit is contained in:
lperrey
2022-08-16 01:46:24 +02:00
parent e691c517e8
commit f8c6923c6d
5 changed files with 91 additions and 49 deletions

View File

@@ -54,7 +54,7 @@ void Webserv::_reopen_lsocket(std::vector<listen_socket>::iterator it)
if (::close(it->fd) == -1)
std::perror("err close()");
std::cerr << "try to reopen lsocket\n";
ret = ::socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0); // (SOCK_CLOEXEC) for CGI fork ?
ret = ::socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK | SOCK_CLOEXEC, 0);
if (ret == -1)
{
std::perror("err socket()");