Initialize timers for Status-Server
authorAlan T. DeKok <aland@freeradius.org>
Fri, 27 Nov 2009 11:07:25 +0000 (12:07 +0100)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 27 Nov 2009 11:07:25 +0000 (12:07 +0100)
For some weird reason they weren't initialized in debugging mode,
so we force it here.  This WAS tested to work... so I have no idea
why it stopped.

We also ignore Status-Server packets when marking home_servers as
alive.  That way, the ping_check will work properly...

src/main/event.c

index 42b2ca6..81c10b8 100644 (file)
@@ -812,6 +812,8 @@ static void ping_home_server(void *ctx)
 
        request->next_callback = NULL;
        request->child_state = REQUEST_PROXIED;
+       gettimeofday(&request->when, NULL);
+       home->when = request->when;
        request->when.tv_sec += home->ping_timeout;;
 
        INSERT_EVENT(no_response_to_ping, request);
@@ -3110,7 +3112,9 @@ REQUEST *received_proxy_response(RADIUS_PACKET *packet)
         *      mark it alive on *any* packet, even if it's lost all
         *      of the *other* packets in the last 10s.
         */
-       request->home_server->state = HOME_STATE_ALIVE;
+       if (request->proxy->code != PW_STATUS_SERVER) {
+               request->home_server->state = HOME_STATE_ALIVE;
+       }
        
 #ifdef WITH_COA
        /*