]> 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)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 25 Oct 2016 18:01:23 +0000 (21:01 +0300)
src/director/director-connection.c
src/director/user-directory.c
src/director/user-directory.h

index 7ba94cc05c749bdfd857a2c0b7e98a180cee6973..e216e39b67a007cde0088ce20e1ded698113203d 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 b643cf5f861e1ea657b0077adf9805ebdb444a42..1ca086a236e768f14a73d6fa6e774faf1c622efd 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 */