
#include "Webserv.hpp"

void	Webserv::_timeout()
{
	std::cerr << "_timeout()\n";
	std::vector<Client>::iterator	it = _clients.begin();
	while (it != _clients.end())
	{
		if (!it->request_complete)
		{
			std::cerr << "timeout request fd " << it->get_cl_fd() << "\n";
			it->status = 408;
			_epoll_update(it->get_cl_fd(), EPOLLOUT, EPOLL_CTL_MOD);

			// DEBUG, close without repsonse 408
			/* _close_client(it->get_cl_fd());
			it = _clients.begin(); */
		}
		// else // DEBUG
		++it;
	}
}
