From: Timo Sirainen Date: Mon, 24 Oct 2016 19:39:56 +0000 (+0300) Subject: director: Log user's kill_state with a human-readable string. X-Git-Tag: 2.2.26~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=825dc91d3b11fea646bcda94c1a327e7d69bc8c0;p=thirdparty%2Fdovecot%2Fcore.git director: Log user's kill_state with a human-readable string. --- diff --git a/src/director/director-connection.c b/src/director/director-connection.c index 7ba94cc05c..e216e39b67 100644 --- a/src/director/director-connection.c +++ b/src/director/director-connection.c @@ -572,8 +572,10 @@ director_user_refresh(struct director_connection *conn, } if (user->to_move != NULL) str_append(str, ",moving"); - if (user->kill_state != USER_KILL_STATE_NONE) - str_printfa(str, ",kill_state=%d", user->kill_state); + if (user->kill_state != USER_KILL_STATE_NONE) { + str_printfa(str, ",kill_state=%s", + user_kill_state_names[user->kill_state]); + } str_append_c(str, ')'); i_error("%s", str_c(str)); diff --git a/src/director/user-directory.c b/src/director/user-directory.c index 67798083d6..0dd8e29483 100644 --- a/src/director/user-directory.c +++ b/src/director/user-directory.c @@ -36,6 +36,15 @@ struct user_directory { unsigned int user_near_expiring_secs; }; +const char *user_kill_state_names[USER_KILL_STATE_DELAY+1] = { + "none", + "killing", + "notify-received", + "waiting-for-notify", + "waiting-for-everyone", + "delay", +}; + static void user_move_iters(struct user_directory *dir, struct user *user) { struct user_directory_iter *const *iterp; diff --git a/src/director/user-directory.h b/src/director/user-directory.h index b643cf5f86..1ca086a236 100644 --- a/src/director/user-directory.h +++ b/src/director/user-directory.h @@ -21,7 +21,9 @@ enum user_kill_state { the user move (although it could be earlier if we added a new USER-MOVED notification). */ USER_KILL_STATE_DELAY + /* NOTE: remember to update also user_kill_state_names[] */ }; +extern const char *user_kill_state_names[USER_KILL_STATE_DELAY+1]; struct user { /* sorted by time */