From 8777601d9c0c48bdaa518d3ebb63801c5b866d52 Mon Sep 17 00:00:00 2001 From: Eduardo Silva Date: Tue, 16 Mar 2010 10:01:38 -0400 Subject: [PATCH] Fix timeout check / update scheduler for KA connections --- src/request.c | 5 ++++- src/scheduler.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/request.c b/src/request.c index d2dc4a9..7f9984f 100644 --- a/src/request.c +++ b/src/request.c @@ -992,5 +992,8 @@ void mk_request_ka_next(struct client_request *cr) cr->body_pos_end = -1; cr->body_length = 0; cr->counter_connections++; -} + /* Update data for scheduler */ + cr->init_time = log_current_utime; + cr->status = MK_REQUEST_STATUS_INCOMPLETE; +} diff --git a/src/scheduler.c b/src/scheduler.c index f05b7ee..768c72e 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -293,7 +293,7 @@ int mk_sched_check_timeouts(struct sched_list_node *sched) while (req_cl) { if (req_cl->status == MK_REQUEST_STATUS_INCOMPLETE) { - if ((req_cl->init_time + config->timeout) >= log_current_utime) { + if ((req_cl->init_time + config->timeout) <= log_current_utime) { #ifdef TRACE MK_TRACE("Scheduler, closing fd %i due to timeout (incomplete)", req_cl->socket); -- 2.11.4.GIT