dovecot-2.2: imap: When client disconnects during a running comm...

dovecot at dovecot.org dovecot at dovecot.org
Thu Nov 12 16:28:26 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/8dae5dc991ce
changeset: 19357:8dae5dc991ce
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Nov 12 18:27:54 2015 +0200
description:
imap: When client disconnects during a running command, log the command wait state.

diffstat:

 src/imap/imap-client.c |  14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diffs (32 lines):

diff -r 4c8f7316a659 -r 8dae5dc991ce src/imap/imap-client.c
--- a/src/imap/imap-client.c	Thu Nov 12 12:28:58 2015 +0200
+++ b/src/imap/imap-client.c	Thu Nov 12 18:27:54 2015 +0200
@@ -33,6 +33,15 @@
 struct client *imap_clients = NULL;
 unsigned int imap_client_count = 0;
 
+static const char *client_command_state_names[CLIENT_COMMAND_STATE_DONE+1] = {
+	"wait-input",
+	"wait-output",
+	"wait-external",
+	"wait-unambiguity",
+	"wait-sync",
+	"done"
+};
+
 static void client_idle_timeout(struct client *client)
 {
 	if (client->output_cmd_lock == NULL)
@@ -295,9 +304,10 @@
 		    (int)((running_usecs+999)/1000 / 1000),
 		    (int)((running_usecs+999)/1000 % 1000), cond_str,
 		    msecs_in_ioloop / 1000, msecs_in_ioloop % 1000);
-	str_printfa(str, ", %llu B in + %llu+%"PRIuSIZE_T" B out)",
+	str_printfa(str, ", %llu B in + %llu+%"PRIuSIZE_T" B out, state=%s)",
 		    bytes_in, bytes_out,
-		    o_stream_get_buffer_used_size(client->output));
+		    o_stream_get_buffer_used_size(client->output),
+		    client_command_state_names[client->command_queue->state]);
 	return str_c(str);
 }
 


More information about the dovecot-cvs mailing list