From: Alan T. DeKok Date: Fri, 8 Jul 2011 12:38:54 +0000 (+0200) Subject: reset timer on receiving reply from home server X-Git-Tag: release_3_0_0_beta0~716 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=459d16b26df9864714647c0ec9467ce6f969e433;p=thirdparty%2Ffreeradius-server.git reset timer on receiving reply from home server This lets the reject_delay = 1 code work. Otherwise, the timer for the request will be left at "wait for reply from home server", which is wrong. There is likely still a race condition, which will be fixed when the "request->proxy" pointer is an actual request. --- diff --git a/src/main/process.c b/src/main/process.c index 6a1a5c3909e..8004107c44e 100644 --- a/src/main/process.c +++ b/src/main/process.c @@ -734,6 +734,7 @@ done: static void request_queue_or_run(UNUSED REQUEST *request, fr_request_process_t process) { + struct timeval now; #ifdef DEBUG_STATE_MACHINE int action = FR_ACTION_TIMER; #endif @@ -746,18 +747,14 @@ static void request_queue_or_run(UNUSED REQUEST *request, #endif /* - * Set the initial delay. + * (re) set the initial delay. */ - if (!request->ev) { - struct timeval now; - - request->delay = USEC / 10; - gettimeofday(&now, NULL); - tv_add(&now, request->delay); - request->delay += request->delay >> 1; - fr_event_insert(el, request_timer, request, &now, + request->delay = USEC / 3; + gettimeofday(&now, NULL); + tv_add(&now, request->delay); + request->delay += request->delay >> 1; + fr_event_insert(el, request_timer, request, &now, &request->ev); - } /* * Do this here so that fewer other functions need to do