]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
director: Code cleanup - move enum user_kill_state to director.h
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 20 Oct 2016 13:41:23 +0000 (16:41 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 26 Oct 2016 10:10:37 +0000 (13:10 +0300)
This will be needed by following commits

src/director/director.c
src/director/director.h
src/director/user-directory.c
src/director/user-directory.h

index 0eddfac46728525e353bc26a3ffcd36fe98a15b1..451a587151856cf4157c306c8bb17913ff75aff4 100644 (file)
 
 bool director_debug;
 
+const char *user_kill_state_names[USER_KILL_STATE_DELAY+1] = {
+       "none",
+       "killing",
+       "notify-received",
+       "waiting-for-notify",
+       "waiting-for-everyone",
+       "flushing",
+       "delay",
+};
+
 static struct log_throttle *user_move_throttle;
 static struct log_throttle *user_kill_fail_throttle;
 
index 9cd6f8f8afcfe0bf4e44022e170b02a8e7c976e1..28bfad4b4eefa2b6cd3b2683cadab4c86933aad7 100644 (file)
@@ -35,6 +35,32 @@ struct director;
 struct mail_host;
 struct user;
 
+enum user_kill_state {
+       /* User isn't being killed */
+       USER_KILL_STATE_NONE,
+       /* We're still killing the user's connections */
+       USER_KILL_STATE_KILLING,
+       /* Like above, but our left side already announced it was finished
+          with killing its user connections */
+       USER_KILL_STATE_KILLING_NOTIFY_RECEIVED,
+       /* We're done killing, but we have to wait for the left side to
+          finish killing its user connections before sending USER-KILLED to
+          our right side */
+       USER_KILL_STATE_KILLED_WAITING_FOR_NOTIFY,
+       /* We're done killing, but waiting for USER-KILLED-EVERYWHERE
+          notification until this state gets reset. */
+       USER_KILL_STATE_KILLED_WAITING_FOR_EVERYONE,
+       /* Waiting for the flush socket to finish. */
+       USER_KILL_STATE_FLUSHING,
+       /* Wait for a while for the user connections to actually die. Note that
+          only at this stage we can be sure that all the directors know about
+          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];
+
 typedef void director_state_change_callback_t(struct director *dir);
 
 struct director {
index f516d4c565ee93d3b347c4598e0c70083c89a7f2..67798083d68bd586a5ad99109da3e77603b90398 100644 (file)
@@ -36,16 +36,6 @@ 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",
-       "flushing",
-       "delay",
-};
-
 static void user_move_iters(struct user_directory *dir, struct user *user)
 {
        struct user_directory_iter *const *iterp;
index ef5b4bf88b4bd0825465fe77ca308a0c09a9dc82..21df29d85e6ff1c6bdf076aaceefa6b465f8ef71 100644 (file)
@@ -1,31 +1,7 @@
 #ifndef USER_DIRECTORY_H
 #define USER_DIRECTORY_H
 
-enum user_kill_state {
-       /* User isn't being killed */
-       USER_KILL_STATE_NONE,
-       /* We're still killing the user's connections */
-       USER_KILL_STATE_KILLING,
-       /* Like above, but our left side already announced it was finished
-          with killing its user connections */
-       USER_KILL_STATE_KILLING_NOTIFY_RECEIVED,
-       /* We're done killing, but we have to wait for the left side to
-          finish killing its user connections before sending USER-KILLED to
-          our right side */
-       USER_KILL_STATE_KILLED_WAITING_FOR_NOTIFY,
-       /* We're done killing, but waiting for USER-KILLED-EVERYWHERE
-          notification until this state gets reset. */
-       USER_KILL_STATE_KILLED_WAITING_FOR_EVERYONE,
-       /* Waiting for the flush socket to finish. */
-       USER_KILL_STATE_FLUSHING,
-       /* Wait for a while for the user connections to actually die. Note that
-          only at this stage we can be sure that all the directors know about
-          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];
+#include "director.h"
 
 struct user {
        /* sorted by time */