[dovecot-cvs]
dovecot/src/lib-storage/index/mbox istream-raw-mbox.c, 1.25, 1.26
cras at dovecot.org
cras at dovecot.org
Sun Dec 19 09:04:16 EET 2004
Update of /var/lib/cvs/dovecot/src/lib-storage/index/mbox
In directory talvi:/tmp/cvs-serv14215/lib-storage/index/mbox
Modified Files:
istream-raw-mbox.c
Log Message:
In some cases we may have crashed if header didn't end with LF+LF.
Index: istream-raw-mbox.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/istream-raw-mbox.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- istream-raw-mbox.c 19 Sep 2004 23:46:33 -0000 1.25
+++ istream-raw-mbox.c 19 Dec 2004 07:04:14 -0000 1.26
@@ -101,11 +101,12 @@
rstream->mail_size = rstream->istream.istream.v_offset + pos -
rstream->hdr_offset;
- if (rstream->body_offset != (uoff_t)-1 &&
- rstream->hdr_offset + rstream->mail_size < rstream->body_offset) {
- /* "headers\n\nFrom ..", the second \n belongs to next
+ if (rstream->hdr_offset + rstream->mail_size < rstream->body_offset) {
+ /* a) Header didn't have ending \n
+ b) "headers\n\nFrom ..", the second \n belongs to next
message which we didn't know at the time yet. */
- i_assert(rstream->body_offset ==
+ i_assert(rstream->body_offset == (uoff_t)-1 ||
+ rstream->body_offset ==
rstream->hdr_offset + rstream->mail_size + 1);
rstream->body_offset =
rstream->hdr_offset + rstream->mail_size;
@@ -126,15 +127,8 @@
i_assert(stream->istream.v_offset >= rstream->from_offset);
- if (stream->istream.eof) {
- if (rstream->body_offset == (uoff_t)-1) {
- /* missing \n from headers */
- rstream->body_offset =
- stream->istream.v_offset +
- (stream->pos - stream->skip);
- }
+ if (stream->istream.eof)
return -1;
- }
i_stream_seek(rstream->input, stream->istream.v_offset);
More information about the dovecot-cvs
mailing list