dovecot-2.2: lib-imap-storage: Removed broken optimization for s...
dovecot at dovecot.org
dovecot at dovecot.org
Fri Jan 11 06:18:54 EET 2013
details: http://hg.dovecot.org/dovecot-2.2/rev/d4e7a3184a82
changeset: 15638:d4e7a3184a82
user: Timo Sirainen <tss at iki.fi>
date: Fri Jan 11 06:18:36 2013 +0200
description:
lib-imap-storage: Removed broken optimization for seeking to partial offset.
The optimization worked only when physical_start=0. It would have been
possible to fix it by finding the message_part where its header of body
offset is physical_start and only then start decreasing virtual_skip, but
probably too much complexity to be worth the trouble, especially since
clients rarely would benefit from this optimization.
diffstat:
src/lib-imap-storage/imap-msgpart.c | 45 -------------------------------------
1 files changed, 0 insertions(+), 45 deletions(-)
diffs (62 lines):
diff -r b0e0eb30c2b9 -r d4e7a3184a82 src/lib-imap-storage/imap-msgpart.c
--- a/src/lib-imap-storage/imap-msgpart.c Fri Jan 11 03:59:50 2013 +0200
+++ b/src/lib-imap-storage/imap-msgpart.c Fri Jan 11 06:18:36 2013 +0200
@@ -371,47 +371,6 @@
return 0;
}
-static void
-skip_using_parts(struct mail *mail, struct istream *input,
- uoff_t physical_start, uoff_t *virtual_skip)
-{
- enum mail_lookup_abort old_lookup_abort;
- struct message_part *parts, *part;
- uoff_t vpos;
- int ret;
-
- old_lookup_abort = mail->lookup_abort;
- mail->lookup_abort = MAIL_LOOKUP_ABORT_NOT_IN_CACHE;
- ret = mail_get_parts(mail, &parts);
- mail->lookup_abort = old_lookup_abort;
- if (ret < 0)
- return;
-
- for (part = parts, vpos = 0; part != NULL; ) {
- if (vpos + part->header_size.virtual_size > *virtual_skip)
- break;
- /* skip header */
- vpos += part->header_size.virtual_size;
- *virtual_skip -= part->header_size.virtual_size;
- i_stream_seek(input, physical_start + part->physical_pos +
- part->header_size.physical_size);
-
- if (vpos + part->body_size.virtual_size <= *virtual_skip) {
- /* skip body */
- vpos += part->body_size.virtual_size;
- *virtual_skip -= part->body_size.virtual_size;
- i_stream_seek(input, physical_start +
- part->physical_pos +
- part->header_size.physical_size +
- part->body_size.physical_size);
- part = part->next;
- } else {
- /* maybe we have a child and can skip using it? */
- part = part->children;
- }
- }
-}
-
static struct istream *
imap_msgpart_crlf_seek(struct mail *mail, struct istream *input,
const struct imap_msgpart *msgpart)
@@ -432,10 +391,6 @@
/* use cache */
i_stream_seek(input, physical_start + cache->physical_pos);
virtual_skip -= cache->virtual_pos;
- } else {
- /* can't use cache, but maybe we can skip faster using the
- message parts. */
- skip_using_parts(mail, input, physical_start, &virtual_skip);
}
if (message_skip_virtual(input, virtual_skip, &cr_skipped) < 0) {
errinput = i_stream_create_error(errno);
More information about the dovecot-cvs
mailing list