]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-imap-client: struct imapc_command - Add start_time
authorMarco Bettini <marco.bettini@open-xchange.com>
Thu, 9 Nov 2023 10:59:40 +0000 (10:59 +0000)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Sat, 18 Nov 2023 17:12:30 +0000 (17:12 +0000)
src/lib-imap-client/imapc-client.h
src/lib-imap-client/imapc-connection.c

index b6e69d06436e8b4c7a3ac01b1ce39c0537a28d8c..816ed44b98ffc6a1cb664decf45dca1f724272bc 100644 (file)
@@ -210,6 +210,7 @@ void imapc_command_sendvf(struct imapc_command *cmd,
 const char *imapc_command_get_tag(struct imapc_command *cmd);
 void imapc_command_abort(struct imapc_command **cmd);
 
+struct timeval imapc_command_get_start_time(struct imapc_command *cmd);
 struct imapc_command *
 imapc_client_find_command_by_tag(struct imapc_client *client, const char *tag);
 
index 85aff705de7a231c9865fa7f86b49db1f646509e..e7060e50bb4c9ba7485d7beaca1dd92ed70d66fb 100644 (file)
@@ -58,6 +58,8 @@ struct imapc_command {
        imapc_command_callback_t *callback;
        void *context;
 
+       struct timeval start_time;
+
        /* This is the AUTHENTICATE command */
        bool authenticate:1;
        /* This is the IDLE command */
@@ -2295,6 +2297,7 @@ static void imapc_connection_cmd_send(struct imapc_command *cmd)
        unsigned int i, count;
 
        imapc_connection_send_idle_done(conn);
+       cmd->start_time = ioloop_timeval;
 
        i_assert((cmd->flags & IMAPC_COMMAND_FLAG_RECONNECTED) == 0);
 
@@ -2569,3 +2572,8 @@ imapc_client_find_command_by_tag(struct imapc_client *client, const char *tag_st
        }
        return NULL;
 }
+
+struct timeval imapc_command_get_start_time(struct imapc_command *cmd)
+{
+       return cmd->start_time;
+}