From: Alan T. DeKok Date: Mon, 14 Sep 2009 12:26:15 +0000 (+0200) Subject: Move "set state" to before log message X-Git-Tag: release_2_1_7~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b67db70a9fa9cc771c61ab50dc8903e4f27f201;p=thirdparty%2Ffreeradius-server.git Move "set state" to before log message To avoid race conditions... though I'm not sure why this would happen --- diff --git a/src/main/event.c b/src/main/event.c index b59dcff3747..1b10dc92fb3 100644 --- a/src/main/event.c +++ b/src/main/event.c @@ -702,7 +702,8 @@ static void ping_home_server(void *ctx) VALUE_PAIR *vp; if ((home->state == HOME_STATE_ALIVE) || - (home->ping_check == HOME_PING_CHECK_NONE)) { + (home->ping_check == HOME_PING_CHECK_NONE) || + (home->ev != NULL)) { return; } @@ -1057,12 +1058,13 @@ static void no_response_to_proxied_request(void *ctx) * of the zombie period. */ if (home->state == HOME_STATE_ALIVE) { + home->state = HOME_STATE_ZOMBIE; + home->zombie_period_start = now; + radlog(L_ERR, "PROXY: Marking home server %s port %d as zombie (it looks like it is dead).", inet_ntop(home->ipaddr.af, &home->ipaddr.ipaddr, buffer, sizeof(buffer)), home->port); - home->state = HOME_STATE_ZOMBIE; - home->zombie_period_start = now; /* * Start pinging the home server.