mirror of
https://github.com/3lswear/webserv.git
synced 2025-10-29 13:27:59 +03:00
add: struct timeval in Client class, and lifeTime in Request
This commit is contained in:
@@ -195,6 +195,22 @@ bool Client::isEmpty(void)
|
||||
return (false);
|
||||
}
|
||||
|
||||
bool Client::TimeToDie(void)
|
||||
{
|
||||
struct timeval curTime;
|
||||
|
||||
gettimeofday(&curTime, NULL);
|
||||
if ((curTime.tv_sec - _time.tv_sec) >= _request.getLifeTime())
|
||||
return (true);
|
||||
else
|
||||
return (false);
|
||||
}
|
||||
|
||||
void Client::updateTimeToDie(void)
|
||||
{
|
||||
gettimeofday(&_time, NULL);
|
||||
}
|
||||
|
||||
void Client::clear(void)
|
||||
{
|
||||
_fd = -1;
|
||||
|
||||
Reference in New Issue
Block a user