From: Timo Sirainen Date: Thu, 12 Nov 2015 16:27:54 +0000 (+0200) Subject: imap: When client disconnects during a running command, log the command wait state. X-Git-Tag: 2.2.20.rc1~95 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=02889f5ce6bf0b825e0dec25404e3781e11bd3f2;p=thirdparty%2Fdovecot%2Fcore.git imap: When client disconnects during a running command, log the command wait state. --- diff --git a/src/imap/imap-client.c b/src/imap/imap-client.c index 3d2e46ba72..d8af0b247d 100644 --- a/src/imap/imap-client.c +++ b/src/imap/imap-client.c @@ -33,6 +33,15 @@ struct imap_module_register imap_module_register = { 0 }; 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 @@ static const char *client_get_commands_status(struct client *client) (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); }