]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
reset timer on receiving reply from home server
authorAlan T. DeKok <aland@freeradius.org>
Fri, 8 Jul 2011 12:38:54 +0000 (14:38 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 8 Jul 2011 12:38:54 +0000 (14:38 +0200)
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.

src/main/process.c

index 6a1a5c3909e9bff650efac609363c4fc35278902..8004107c44e3b50d1a74b84e04832cbd3f02c4e8 100644 (file)
@@ -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