dovecot-2.2: imap: Removed separate time counting from SELECT an...
dovecot at dovecot.org
dovecot at dovecot.org
Tue Apr 21 11:08:19 UTC 2015
details: http://hg.dovecot.org/dovecot-2.2/rev/b651fba04408
changeset: 18433:b651fba04408
user: Timo Sirainen <tss at iki.fi>
date: Tue Apr 21 14:06:41 2015 +0300
description:
imap: Removed separate time counting from SELECT and SEARCH commands.
diffstat:
src/imap/cmd-select.c | 10 ++--------
src/imap/imap-search.c | 13 ++-----------
src/imap/imap-search.h | 1 -
3 files changed, 4 insertions(+), 20 deletions(-)
diffs (84 lines):
diff -r abf2727d469a -r b651fba04408 src/imap/cmd-select.c
--- a/src/imap/cmd-select.c Tue Apr 21 14:06:22 2015 +0300
+++ b/src/imap/cmd-select.c Tue Apr 21 14:06:41 2015 +0300
@@ -201,8 +201,6 @@
static void cmd_select_finish(struct imap_select_context *ctx, int ret)
{
const char *resp_code;
- struct timeval end_time;
- int time_msecs;
if (ret < 0) {
if (ctx->box != NULL)
@@ -211,13 +209,9 @@
} else {
resp_code = mailbox_is_readonly(ctx->box) ?
"READ-ONLY" : "READ-WRITE";
- if (gettimeofday(&end_time, NULL) < 0)
- memset(&end_time, 0, sizeof(end_time));
- time_msecs = timeval_diff_msecs(&end_time, &ctx->start_time);
client_send_tagline(ctx->cmd, t_strdup_printf(
- "OK [%s] %s completed (%d.%03d secs).", resp_code,
- ctx->cmd->client->mailbox_examined ? "Examine" : "Select",
- time_msecs/1000, time_msecs%1000));
+ "OK [%s] %s completed", resp_code,
+ ctx->cmd->client->mailbox_examined ? "Examine" : "Select"));
}
select_context_free(ctx);
}
diff -r abf2727d469a -r b651fba04408 src/imap/imap-search.c
--- a/src/imap/imap-search.c Tue Apr 21 14:06:22 2015 +0300
+++ b/src/imap/imap-search.c Tue Apr 21 14:06:41 2015 +0300
@@ -415,12 +415,10 @@
enum search_return_options opts = ctx->return_options;
struct mail *mail;
enum mailbox_sync_flags sync_flags;
- struct timeval end_time;
const struct seq_range *range;
unsigned int count;
uint32_t id, id_min, id_max;
const char *ok_reply;
- int time_msecs;
bool tryagain, minmax, lost_data;
if (cmd->cancel) {
@@ -503,18 +501,12 @@
return TRUE;
}
- if (gettimeofday(&end_time, NULL) < 0)
- memset(&end_time, 0, sizeof(end_time));
-
- time_msecs = timeval_diff_msecs(&end_time, &ctx->start_time);
-
sync_flags = MAILBOX_SYNC_FLAG_FAST;
if (!cmd->uid || ctx->have_seqsets)
sync_flags |= MAILBOX_SYNC_FLAG_NO_EXPUNGES;
- ok_reply = t_strdup_printf("OK %s%s completed (%d.%03d secs).",
+ ok_reply = t_strdup_printf("OK %s%s completed",
lost_data ? "["IMAP_RESP_CODE_EXPUNGEISSUED"] " : "",
- !ctx->sorting ? "Search" : "Sort",
- time_msecs/1000, time_msecs%1000);
+ !ctx->sorting ? "Search" : "Sort");
return cmd_sync(cmd, sync_flags, 0, ok_reply);
}
@@ -594,7 +586,6 @@
ctx->search_ctx =
mailbox_search_init(ctx->trans, sargs, sort_program, 0, NULL);
ctx->sorting = sort_program != NULL;
- (void)gettimeofday(&ctx->start_time, NULL);
i_array_init(&ctx->result, 128);
if ((ctx->return_options & SEARCH_RETURN_UPDATE) != 0)
imap_search_result_save(ctx);
diff -r abf2727d469a -r b651fba04408 src/imap/imap-search.h
--- a/src/imap/imap-search.h Tue Apr 21 14:06:22 2015 +0300
+++ b/src/imap/imap-search.h Tue Apr 21 14:06:41 2015 +0300
@@ -41,7 +41,6 @@
float min_relevancy, max_relevancy;
uint64_t highest_seen_modseq;
- struct timeval start_time;
unsigned int have_seqsets:1;
unsigned int have_modseqs:1;
More information about the dovecot-cvs
mailing list