]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: Set command start timestamps earlier.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 13 May 2016 18:22:40 +0000 (14:22 -0400)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 13 May 2016 18:22:40 +0000 (14:22 -0400)
Previously timing statistics in taglines weren't shown commands that didn't
read any parameters.

Also the timings now include the time speng reading command parameters from
client. For example:

a list "" {1}
+ OK
%
* LIST (\HasNoChildren) "/" INBOX
a OK List completed (0.001 + 1.214 secs).

src/imap/imap-client.c

index 76424f26b1a375ed06734759b55dc3216fddde3a..6392d5ff76f10814e0cdcf799843d8c8f22eea27 100644 (file)
@@ -584,9 +584,6 @@ bool client_read_args(struct client_command_context *cmd, unsigned int count,
                str = t_str_new(256);
                imap_write_args(str, *args_r);
                cmd->args = p_strdup(cmd->pool, str_c(str));
-               cmd->start_time = ioloop_timeval;
-               cmd->start_ioloop_wait_usecs =
-                       io_loop_get_wait_usecs(current_ioloop);
 
                cmd->client->input_lock = NULL;
                return TRUE;
@@ -723,6 +720,8 @@ struct client_command_context *client_command_alloc(struct client *client)
        cmd = p_new(client->command_pool, struct client_command_context, 1);
        cmd->client = client;
        cmd->pool = client->command_pool;
+       cmd->start_time = ioloop_timeval;
+       cmd->start_ioloop_wait_usecs = io_loop_get_wait_usecs(current_ioloop);
        p_array_init(&cmd->module_contexts, cmd->pool, 5);
 
        DLLIST_PREPEND(&client->command_queue, cmd);