]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
message_skip_virtual() calculated returned msg_size wrong. This could have
authorTimo Sirainen <tss@iki.fi>
Thu, 20 Nov 2003 15:40:09 +0000 (17:40 +0200)
committerTimo Sirainen <tss@iki.fi>
Thu, 20 Nov 2003 15:40:09 +0000 (17:40 +0200)
caused some problems with partial body fetches.

--HG--
branch : HEAD

src/lib-mail/message-send.c

index 294c966f4af0a677e51973f030462178c63d5b18..6a541a9b950b0175a1de4c063701898f08a8b721 100644 (file)
@@ -122,19 +122,15 @@ void message_skip_virtual(struct istream *input, uoff_t virtual_skip,
                        }
                }
 
+               i_stream_skip(input, i);
                if (msg_size != NULL) {
                        msg_size->physical_size += i;
                        msg_size->virtual_size += i;
                }
 
-               if (i < size) {
-                       i_stream_skip(input, i);
+               if (i < size)
                        break;
-               }
 
-               /* leave the last character, it may be \r */
-               i_stream_skip(input, i - 1);
-               startpos = 1;
-               cr_skipped = FALSE;
+               cr_skipped = msg[i-1] == '\r';
        }
 }