This makes timing shown in reply to unknown commands correct
if (cmd->func == NULL) {
/* unknown command */
+ io_loop_time_refresh();
+ command_stats_start(cmd);
client_send_command_error(cmd, "Unknown command.");
cmd->param_error = TRUE;
client_command_free(&cmd);
i_panic("command_hook_unregister(): hook not registered");
}
-static void command_stats_start(struct client_command_context *cmd)
+void command_stats_start(struct client_command_context *cmd)
{
cmd->stats_start.timeval = ioloop_timeval;
cmd->stats_start.lock_wait_usecs = file_lock_wait_get_total_usecs();
command_hook_callback_t *post);
/* Execute command and hooks */
bool command_exec(struct client_command_context *cmd);
+/* Starts counting command statistics. */
+void command_stats_start(struct client_command_context *cmd);
/* Finish counting command statistics. This is called automatically when
command_exec() returns, but it should be called explicitly if the stats are
needed during command_exec(). */