wip cgi env variables

This commit is contained in:
hugogogo
2022-08-06 11:34:48 +02:00
parent 83536ee8ad
commit 6f171ec07b
6 changed files with 66 additions and 14 deletions

View File

@@ -22,5 +22,19 @@ void Webserv::_accept_connection(int fd)
_clients.push_back(Client());
_clients.back().fd = accepted_fd;
// HUGO WIP
//
_clients.back().port = ::itos(addr.sin_port);
struct in_addr tmp = { addr.sin_addr.s_addr };
_clients.back().ip = inet_ntoa( tmp );
std::cout
<< "port:" << _clients.back().port
<< " ip:" << _clients.back().ip
<< "\n";
//
// HUGO END
_epoll_update(accepted_fd, EPOLLIN, EPOLL_CTL_ADD);
}