From: Timo Sirainen Date: Fri, 24 Oct 2008 19:10:37 +0000 (+0300) Subject: QRESYNC: FETCH CHANGEDSINCE and SELECT with modseq shouldn't have returned changes... X-Git-Tag: 1.2.alpha4~167 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3a985b4f3481d7061ee0c6ace3a5bb0bcbcb67ad;p=thirdparty%2Fdovecot%2Fcore.git QRESYNC: FETCH CHANGEDSINCE and SELECT with modseq shouldn't have returned changes with the same modseq. --HG-- branch : HEAD --- diff --git a/src/imap/cmd-fetch.c b/src/imap/cmd-fetch.c index 0e50fd876d..91c52eb9ae 100644 --- a/src/imap/cmd-fetch.c +++ b/src/imap/cmd-fetch.c @@ -82,7 +82,7 @@ fetch_parse_modifier(struct imap_fetch_context *ctx, } num = strtoull(imap_arg_string(*args), NULL, 10); *args += 1; - return imap_fetch_add_unchanged_since(ctx, num); + return imap_fetch_add_changed_since(ctx, num); } if (strcmp(name, "VANISHED") == 0 && ctx->cmd->uid) { if ((ctx->client->enabled_features & diff --git a/src/imap/cmd-select.c b/src/imap/cmd-select.c index f98ee9a193..bdfa87c66b 100644 --- a/src/imap/cmd-select.c +++ b/src/imap/cmd-select.c @@ -232,7 +232,7 @@ static int select_qresync(struct imap_select_context *ctx) fetch_ctx->qresync_sample_seqset = &ctx->qresync_sample_seqset; fetch_ctx->qresync_sample_uidset = &ctx->qresync_sample_uidset; - if (!imap_fetch_add_unchanged_since(fetch_ctx, ctx->qresync_modseq) || + if (!imap_fetch_add_changed_since(fetch_ctx, ctx->qresync_modseq) || !imap_fetch_init_handler(fetch_ctx, "UID", NULL) || !imap_fetch_init_handler(fetch_ctx, "FLAGS", NULL) || !imap_fetch_init_handler(fetch_ctx, "MODSEQ", NULL)) { diff --git a/src/imap/imap-fetch.c b/src/imap/imap-fetch.c index 51e8c10920..d6c04e5f55 100644 --- a/src/imap/imap-fetch.c +++ b/src/imap/imap-fetch.c @@ -110,8 +110,8 @@ imap_fetch_init(struct client_command_context *cmd, struct mailbox *box) return ctx; } -bool imap_fetch_add_unchanged_since(struct imap_fetch_context *ctx, - uint64_t modseq) +bool imap_fetch_add_changed_since(struct imap_fetch_context *ctx, + uint64_t modseq) { struct mail_search_arg *search_arg; @@ -119,7 +119,7 @@ bool imap_fetch_add_unchanged_since(struct imap_fetch_context *ctx, search_arg->type = SEARCH_MODSEQ; search_arg->value.modseq = p_new(ctx->cmd->pool, struct mail_search_modseq, 1); - search_arg->value.modseq->modseq = modseq; + search_arg->value.modseq->modseq = modseq + 1; search_arg->next = ctx->search_args->args->next; ctx->search_args->args->next = search_arg; diff --git a/src/imap/imap-fetch.h b/src/imap/imap-fetch.h index a301ea2769..e61a5336d8 100644 --- a/src/imap/imap-fetch.h +++ b/src/imap/imap-fetch.h @@ -101,8 +101,8 @@ int imap_fetch_deinit(struct imap_fetch_context *ctx); bool imap_fetch_init_handler(struct imap_fetch_context *ctx, const char *name, const struct imap_arg **args); -bool imap_fetch_add_unchanged_since(struct imap_fetch_context *ctx, - uint64_t modseq); +bool imap_fetch_add_changed_since(struct imap_fetch_context *ctx, + uint64_t modseq); int imap_fetch_begin(struct imap_fetch_context *ctx); int imap_fetch_more(struct imap_fetch_context *ctx);