]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
director: Log user's kill_state with a human-readable string.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 24 Oct 2016 19:39:56 +0000 (22:39 +0300)
committerGitLab <gitlab@git.dovecot.net>
Tue, 25 Oct 2016 17:33:27 +0000 (20:33 +0300)
src/director/director-connection.c
src/director/user-directory.c
src/director/user-directory.h

index e467423aaebfa89d5fbb14858ef22f59bd8ef7e6..bd585f42f0219b0bc261116fae61abf038955754 100644 (file)
@@ -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));
 
index 67798083d68bd586a5ad99109da3e77603b90398..0dd8e2948331c70d5310c450a826af3d94ecf802 100644 (file)
@@ -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;
index cbcd4a6934820c2e9daf41129c3edc4f5c36a751..4e6da58858265dd80949d485bee4833351cda4c3 100644 (file)
@@ -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 */