SpecialProxy/timeout.c

22 lines
432 B
C
Raw Normal View History

2018-12-07 09:29:41 +08:00
#include "main.h"
#include "http.h"
2019-01-26 11:53:32 +08:00
int timeout_minute;
2018-12-07 09:29:41 +08:00
void *close_timeout_connectionLoop(void *nullPtr)
{
2018-12-21 19:13:07 +08:00
int i;
2018-12-07 09:29:41 +08:00
while (1)
{
2019-01-26 11:53:32 +08:00
sleep(60);
2018-12-07 09:29:41 +08:00
for (i = 0; i < MAX_CONNECTION; i += 2)
2019-01-26 11:53:32 +08:00
if (cts[i].fd > -1)
{
if (cts[i].timer >= timeout_minute)
close_connection(cts + i);
else
2019-02-19 12:27:43 +08:00
cts[i].timer++;
2019-01-26 11:53:32 +08:00
}
2018-12-07 09:29:41 +08:00
}
}