projects
/
freeradius.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fa93a22
)
Set a timer for marking a home server dead. Closes #712
author
Alan T. DeKok
<aland@freeradius.org>
Thu, 26 Jun 2014 12:33:32 +0000
(08:33 -0400)
committer
Alan T. DeKok
<aland@freeradius.org>
Thu, 26 Jun 2014 12:33:32 +0000
(08:33 -0400)
src/main/process.c
patch
|
blob
|
history
diff --git
a/src/main/process.c
b/src/main/process.c
index
16345df
..
2a70e23
100644
(file)
--- a/
src/main/process.c
+++ b/
src/main/process.c
@@
-3055,7
+3055,6
@@
static void ping_home_server(void *ctx)
struct timeval when, now;
if ((home->state == HOME_STATE_ALIVE) ||
struct timeval when, now;
if ((home->state == HOME_STATE_ALIVE) ||
- (home->ping_check == HOME_PING_CHECK_NONE) ||
#ifdef WITH_TCP
(home->proto == IPPROTO_TCP) ||
#endif
#ifdef WITH_TCP
(home->proto == IPPROTO_TCP) ||
#endif
@@
-3065,6
+3064,9
@@
static void ping_home_server(void *ctx)
gettimeofday(&now, NULL);
gettimeofday(&now, NULL);
+ /*
+ * We've run out of zombie time. Mark it dead.
+ */
if (home->state == HOME_STATE_ZOMBIE) {
when = home->zombie_period_start;
when.tv_sec += home->zombie_period;
if (home->state == HOME_STATE_ZOMBIE) {
when = home->zombie_period_start;
when.tv_sec += home->zombie_period;
@@
-3076,6
+3078,25
@@
static void ping_home_server(void *ctx)
}
}
}
}
+ /*
+ * We're not supposed to be pinging it. Just wake up
+ * when we're supposed to mark it dead.
+ */
+ if (home->ping_check == HOME_PING_CHECK_NONE) {
+ if (home->state == HOME_STATE_ZOMBIE) {
+ when = home->zombie_period_start;
+ when.tv_sec += home->zombie_period;
+ INSERT_EVENT(ping_home_server, home);
+ }
+
+ /*
+ * Else mark_home_server_dead will set a timer
+ * for revive_interval.
+ */
+ return;
+ }
+
+
request = request_alloc(NULL);
request->number = request_num_counter++;
NO_CHILD_THREAD;
request = request_alloc(NULL);
request->number = request_num_counter++;
NO_CHILD_THREAD;