[Dovecot] FETCH order fix backport to stable from test66

Chris Wakelin c.d.wakelin at reading.ac.uk
Tue Apr 5 14:34:34 EEST 2005


I've had a go at back-porting Timo's recent fixes to the IMAP fetch 
command from 1.0-test66 to 1.0-stable.

This seems to fix the problem with kmail, and Thunderbird seems to 
work fine without its RFC822.SIZE fix.

It's a bit big for the body of this message, so it's attached.

The bit I'm most concerned about in my port is whether I got the 
buffer_insert call right (back-ported from an array_insert call) in 
imap-fetch.c :-

@@ -119,8 +129,14 @@
        memset(&h, 0, sizeof(h));
        h.handler = handler;
        h.context = context;
+       h.buffered = buffered;

-       buffer_append(ctx->handlers, &h, sizeof(h));
+       if (!buffered)
+               buffer_append(ctx->handlers, &h, sizeof(h));
+       else {
+               buffer_insert(ctx->handlers, ctx->buffered_handlers_count * size
of(h), &h, sizeof(h));
+                ctx->buffered_handlers_count++;
+       }
 }

Best Wishes,
Chris

--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+--
Christopher Wakelin,                                c.d.wakelin at reading.ac.uk
IT Services Centre, The University of Reading,       Tel: +44 (0)118 378 8439
Whiteknights, Reading, RG6 2AF, UK                   Fax: +44 (0)118 975 3094
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmd-fetch.backport.patch
Type: application/octet-stream
Size: 9153 bytes
Desc: not available
URL: <http://dovecot.org/pipermail/dovecot/attachments/20050405/337770e3/attachment-0003.obj>


More information about the dovecot mailing list