
#include "Webserv.hpp"

bool	g_run;
int		g_last_signal;

void	signal_handler(int signum)
{
	g_last_signal = signum;
}

void	Webserv::_handle_last_signal()
{
	if (g_last_signal == SIGPIPE)
	{
		std::cerr << "SIGPIPE\n";
		// if (_actual_client)
		// {
		// 	_close_client(_actual_client->fd);
		// 	_actual_client = NULL;
		// }
	}
	else if (g_last_signal == SIGINT)
	{
		g_run = false;
		// maybe a throw here instead of "g_run" ?
	}
	g_last_signal = 0;
}
