dovecot-2.2: imap: Fixed SEARCH PARTIAL to work correctly with U...
dovecot at dovecot.org
dovecot at dovecot.org
Mon May 5 11:03:27 UTC 2014
details: http://hg.dovecot.org/dovecot-2.2/rev/defefebf5f99
changeset: 17313:defefebf5f99
user: Timo Sirainen <tss at iki.fi>
date: Mon May 05 14:02:58 2014 +0300
description:
imap: Fixed SEARCH PARTIAL to work correctly with UIDs and with SORT results.
diffstat:
src/imap/imap-search.c | 20 ++------------------
1 files changed, 2 insertions(+), 18 deletions(-)
diffs (32 lines):
diff -r 0d237a4dacd2 -r defefebf5f99 src/imap/imap-search.c
--- a/src/imap/imap-search.c Mon May 05 14:02:16 2014 +0300
+++ b/src/imap/imap-search.c Mon May 05 14:02:58 2014 +0300
@@ -228,26 +228,10 @@
static void
imap_search_send_partial(struct imap_search_context *ctx, string_t *str)
{
- struct seq_range *range;
- unsigned int i, count;
-
str_printfa(str, " PARTIAL (%u:%u ", ctx->partial1, ctx->partial2);
- /* we need to be able to handle non-sorted seq ranges (for SORT
- replies), so do this ourself instead of using seq_range_array_*()
- functions. */
- range = array_get_modifiable(&ctx->result, &count);
- for (i = count; i > 0; ) {
- i--;
- if (range[i].seq1 < ctx->partial1)
- range[i].seq1 = ctx->partial1;
- if (range[i].seq2 > ctx->partial2)
- range[i].seq2 = ctx->partial2;
- if (range[i].seq1 > range[i].seq2) {
- array_delete(&ctx->result, i, 1);
- range = array_get_modifiable(&ctx->result, &count);
- }
- }
+ seq_range_array_remove_nth(&ctx->result, ctx->partial2, (uint32_t)-1);
+ seq_range_array_remove_nth(&ctx->result, 0, ctx->partial1-1);
if (array_count(&ctx->result) == 0) {
/* no results (in range) */
More information about the dovecot-cvs
mailing list