make sure we dont check for timeouts on every iteration; disconnecting clients due to timeouts is info, not error
Costa Tsaousis (ktsaou) committed
Jan 16, 2018 at 00:22 UTC
71118f670229057c324041a42b459b7534ac0b94
1 file changed
+4
-4
src/socket.c
+4
-4
@@ -1410,14 +1410,15 @@ void poll_events(LISTEN_SOCKETS *sockets
1410
}
1411
1412
if(now - last_check > p.checks_every) {
1413
+ last_check = now;
1414
+
1415
// security checks
1416
for(i = 0; i <= p.max; i++) {
1417
POLLINFO *pi = &p.inf[i];
1418
1419
if(likely(pi->flags & POLLINFO_FLAG_CLIENT_SOCKET)) {
1420
if (unlikely(pi->send_count == 0 && (now - pi->connected_t) >= p.complete_request_timeout)) {
1419
- errno = 0;
1420
- error("POLLFD: LISTENER: client slot %zu (fd %d) from '%s:%s' has not sent a complete request in %zu seconds - closing it. "
1421
+ info("POLLFD: LISTENER: client slot %zu (fd %d) from '%s:%s' has not sent a complete request in %zu seconds - closing it. "
1422
, i
1423
, pi->fd
1424
, pi->client_ip ? pi->client_ip : "<undefined-ip>"
@@ -1427,8 +1428,7 @@ void poll_events(LISTEN_SOCKETS *sockets
1428
poll_close_fd(pi);
1429
}
1430
else if(unlikely(pi->recv_count && now - ((pi->last_received_t > pi->last_sent_t) ? pi->last_received_t : pi->last_sent_t) >= p.idle_timeout )) {
1430
- errno = 0;
1431
- error("POLLFD: LISTENER: client slot %zu (fd %d) from '%s:%s' is idle for more than %zu seconds - closing it. "
1431
+ info("POLLFD: LISTENER: client slot %zu (fd %d) from '%s:%s' is idle for more than %zu seconds - closing it. "
1432
, i
1433
, pi->fd
1434
, pi->client_ip ? pi->client_ip : "<undefined-ip>"