From 53a1e5c4be455bbe50761ec411e584ec76687046 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Tue, 24 Nov 2009 12:59:43 +0000 Subject: [PATCH] Fix SMTP checker adding himself repeatedly in the list of failed checkers When a SMTP check has already failed, SMTP checker will add itself again to the list of failed checks. For example, if the check fails 10 times in a row, the SMTP check will be present 10 times in the list of failed checks. This means that to be considered alive again, it should succeed 10 times. Other checkers just add themselves to the list of failed checkers only if they are not already present. We do the same here. --- keepalived/check/check_smtp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/keepalived/check/check_smtp.c b/keepalived/check/check_smtp.c index 29c55e8..edae298 100644 --- a/keepalived/check/check_smtp.c +++ b/keepalived/check/check_smtp.c @@ -329,10 +329,9 @@ smtp_final(thread *thread_obj, int error, const char *format, ...) smtp_buff[542 - 1] = '\0'; smtp_alert(chk->rs, NULL, NULL, "DOWN", smtp_buff); + update_svr_checker_state(DOWN, chk->id, chk->vs, chk->rs); } - update_svr_checker_state(DOWN, chk->id, chk->vs, chk->rs); - /* Reset everything back to the first host in the list */ smtp_chk->attempts = 0; smtp_chk->host_ctr = 0; -- 1.7.10.4