Mercurial > dovecot > original-hg > dovecot-1.2
changeset 6751:a6782f59c44f HEAD
Removed MAILBOX_OPEN_MBOX_ONE_MSG_ONLY flag and handling. Raw storage
replaced its functionality.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 08 Nov 2007 21:27:44 +0200 |
parents | b822b7b78d7b |
children | 75f7163d4379 |
files | src/lib-storage/index/mbox/istream-raw-mbox.c src/lib-storage/index/mbox/istream-raw-mbox.h src/lib-storage/index/mbox/mbox-file.c src/lib-storage/mail-storage.h |
diffstat | 4 files changed, 15 insertions(+), 30 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/mbox/istream-raw-mbox.c Thu Nov 08 21:25:55 2007 +0200 +++ b/src/lib-storage/index/mbox/istream-raw-mbox.c Thu Nov 08 21:27:44 2007 +0200 @@ -16,7 +16,6 @@ struct istream *input; uoff_t input_peak_offset; - unsigned int one_mail_only:1; unsigned int crlf_ending:1; unsigned int corrupted:1; unsigned int eof:1; @@ -238,18 +237,16 @@ rest of the line buffered. FIXME: if From-line is longer than input buffer, we break. probably irrelevant.. */ - if (!rstream->one_mail_only) { - i++; - from_after_pos = i; - from_start_pos = i - 6; - if (from_start_pos > 0 && - buf[from_start_pos-1] == '\r') { - /* CR also belongs to it. */ - crlf_ending = TRUE; - from_start_pos--; - } else { - crlf_ending = FALSE; - } + i++; + from_after_pos = i; + from_start_pos = i - 6; + if (from_start_pos > 0 && + buf[from_start_pos-1] == '\r') { + /* CR also belongs to it. */ + crlf_ending = TRUE; + from_start_pos--; + } else { + crlf_ending = FALSE; } fromp = mbox_from; } else if (from_start_pos != (size_t)-1) { @@ -345,8 +342,7 @@ return &stream->statbuf; } -struct istream *i_stream_create_raw_mbox(struct istream *input, - bool kludge_one_mail_only) +struct istream *i_stream_create_raw_mbox(struct istream *input) { struct raw_mbox_istream *rstream; @@ -354,7 +350,6 @@ rstream = i_new(struct raw_mbox_istream, 1); - rstream->one_mail_only = kludge_one_mail_only; rstream->input = input; rstream->body_offset = (uoff_t)-1; rstream->mail_size = (uoff_t)-1;
--- a/src/lib-storage/index/mbox/istream-raw-mbox.h Thu Nov 08 21:25:55 2007 +0200 +++ b/src/lib-storage/index/mbox/istream-raw-mbox.h Thu Nov 08 21:27:44 2007 +0200 @@ -3,8 +3,7 @@ /* Create a mbox stream for parsing mbox. Reading stops before From-line, you'll have to call istream_raw_mbox_next() to get to next message. */ -struct istream *i_stream_create_raw_mbox(struct istream *input, - bool kludge_one_mail_only); +struct istream *i_stream_create_raw_mbox(struct istream *input); /* Return offset to beginning of the "\nFrom"-line. */ uoff_t istream_raw_mbox_get_start_offset(struct istream *stream);
--- a/src/lib-storage/index/mbox/mbox-file.c Thu Nov 08 21:25:55 2007 +0200 +++ b/src/lib-storage/index/mbox/mbox-file.c Thu Nov 08 21:27:44 2007 +0200 @@ -60,21 +60,15 @@ int mbox_file_open_stream(struct mbox_mailbox *mbox) { - bool one_mail_only; - if (mbox->mbox_stream != NULL) return 0; - one_mail_only = - (mbox->ibox.open_flags & MAILBOX_OPEN_MBOX_ONE_MSG_ONLY) != 0; - if (mbox->mbox_file_stream != NULL) { /* read-only mbox stream */ i_assert(mbox->mbox_fd == -1 && mbox->mbox_readonly); mbox->mbox_stream = - i_stream_create_raw_mbox(mbox->mbox_file_stream, - one_mail_only); + i_stream_create_raw_mbox(mbox->mbox_file_stream); return 0; } @@ -91,8 +85,7 @@ MAIL_READ_BLOCK_SIZE, FALSE); } - mbox->mbox_stream = - i_stream_create_raw_mbox(mbox->mbox_file_stream, one_mail_only); + mbox->mbox_stream = i_stream_create_raw_mbox(mbox->mbox_file_stream); return 0; }
--- a/src/lib-storage/mail-storage.h Thu Nov 08 21:25:55 2007 +0200 +++ b/src/lib-storage/mail-storage.h Thu Nov 08 21:27:44 2007 +0200 @@ -54,9 +54,7 @@ /* Don't create index files for the mailbox */ MAILBOX_OPEN_NO_INDEX_FILES = 0x10, /* Keep mailbox exclusively locked all the time while it's open */ - MAILBOX_OPEN_KEEP_LOCKED = 0x20, - /* FIXME: Kludge for deliver: Ignore all but the first From-line */ - MAILBOX_OPEN_MBOX_ONE_MSG_ONLY = 0x40 + MAILBOX_OPEN_KEEP_LOCKED = 0x20 }; enum mailbox_status_items {