dovecot-2.0: lib-storage: Actually use MAIL_READ_BLOCK_SIZE size...
dovecot at dovecot.org
dovecot at dovecot.org
Thu Aug 13 19:24:53 EEST 2009
details: http://hg.dovecot.org/dovecot-2.0/rev/3bbad277bef0
changeset: 9778:3bbad277bef0
user: Timo Sirainen <tss at iki.fi>
date: Thu Aug 13 12:23:44 2009 -0400
description:
lib-storage: Actually use MAIL_READ_BLOCK_SIZE sized blocks when reading mails.
diffstat:
5 files changed, 10 insertions(+), 1 deletion(-)
src/lib-storage/index/cydir/cydir-mail.c | 2 ++
src/lib-storage/index/dbox/dbox-file.c | 1 +
src/lib-storage/index/maildir/maildir-mail.c | 5 ++++-
src/lib-storage/index/mbox/mbox-file.c | 2 ++
src/lib-storage/index/raw/raw-storage.c | 1 +
diffs (68 lines):
diff -r 85abd99007c3 -r 3bbad277bef0 src/lib-storage/index/cydir/cydir-mail.c
--- a/src/lib-storage/index/cydir/cydir-mail.c Thu Aug 13 12:22:45 2009 -0400
+++ b/src/lib-storage/index/cydir/cydir-mail.c Thu Aug 13 12:23:44 2009 -0400
@@ -114,6 +114,8 @@ cydir_mail_get_stream(struct mail *_mail
}
mail->data.stream =
i_stream_create_fd(fd, MAIL_READ_BLOCK_SIZE, TRUE);
+ i_stream_set_init_buffer_size(mail->data.stream,
+ MAIL_READ_BLOCK_SIZE);
}
return index_mail_init_stream(mail, hdr_size, body_size, stream_r);
diff -r 85abd99007c3 -r 3bbad277bef0 src/lib-storage/index/dbox/dbox-file.c
--- a/src/lib-storage/index/dbox/dbox-file.c Thu Aug 13 12:22:45 2009 -0400
+++ b/src/lib-storage/index/dbox/dbox-file.c Thu Aug 13 12:23:44 2009 -0400
@@ -428,6 +428,7 @@ int dbox_file_open(struct dbox_file *fil
}
file->input = i_stream_create_fd(file->fd, MAIL_READ_BLOCK_SIZE, FALSE);
+ i_stream_set_init_buffer_size(file->input, MAIL_READ_BLOCK_SIZE);
return file->maildir_file ? 1 :
dbox_file_read_header(file);
}
diff -r 85abd99007c3 -r 3bbad277bef0 src/lib-storage/index/maildir/maildir-mail.c
--- a/src/lib-storage/index/maildir/maildir-mail.c Thu Aug 13 12:22:45 2009 -0400
+++ b/src/lib-storage/index/maildir/maildir-mail.c Thu Aug 13 12:23:44 2009 -0400
@@ -45,6 +45,7 @@ maildir_open_mail(struct maildir_mailbox
bool *deleted_r)
{
struct mail_private *p = (struct mail_private *)mail;
+ struct istream *input;
const char *path;
int fd = -1;
@@ -65,7 +66,9 @@ maildir_open_mail(struct maildir_mailbox
return NULL;
}
- return i_stream_create_fd(fd, MAIL_READ_BLOCK_SIZE, TRUE);
+ input = i_stream_create_fd(fd, MAIL_READ_BLOCK_SIZE, TRUE);
+ i_stream_set_init_buffer_size(input, MAIL_READ_BLOCK_SIZE);
+ return input;
}
static int maildir_mail_stat(struct mail *mail, struct stat *st)
diff -r 85abd99007c3 -r 3bbad277bef0 src/lib-storage/index/mbox/mbox-file.c
--- a/src/lib-storage/index/mbox/mbox-file.c Thu Aug 13 12:22:45 2009 -0400
+++ b/src/lib-storage/index/mbox/mbox-file.c Thu Aug 13 12:23:44 2009 -0400
@@ -80,6 +80,8 @@ int mbox_file_open_stream(struct mbox_ma
mbox->mbox_file_stream =
i_stream_create_fd(mbox->mbox_fd,
MAIL_READ_BLOCK_SIZE, FALSE);
+ i_stream_set_init_buffer_size(mbox->mbox_file_stream,
+ MAIL_READ_BLOCK_SIZE);
}
}
diff -r 85abd99007c3 -r 3bbad277bef0 src/lib-storage/index/raw/raw-storage.c
--- a/src/lib-storage/index/raw/raw-storage.c Thu Aug 13 12:22:45 2009 -0400
+++ b/src/lib-storage/index/raw/raw-storage.c Thu Aug 13 12:23:44 2009 -0400
@@ -86,6 +86,7 @@ static int raw_mailbox_open(struct mailb
return -1;
}
box->input = i_stream_create_fd(fd, MAIL_READ_BLOCK_SIZE, TRUE);
+ i_stream_set_init_buffer_size(box->input, MAIL_READ_BLOCK_SIZE);
return index_storage_mailbox_open(box);
}
More information about the dovecot-cvs
mailing list