dovecot-1.2: lib-storage: Actually use MAIL_READ_BLOCK_SIZE size...

dovecot at dovecot.org dovecot at dovecot.org
Thu Aug 13 19:24:48 EEST 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/2fd8d3a2bd52
changeset: 9316:2fd8d3a2bd52
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Aug 13 12:24:42 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 70593ef74836 -r 2fd8d3a2bd52 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:24:42 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 70593ef74836 -r 2fd8d3a2bd52 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:24:42 2009 -0400
@@ -432,6 +432,7 @@ static int dbox_file_open(struct dbox_fi
 	}
 
 	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 !read_header || file->maildir_file ? 1 :
 		dbox_file_read_header(file);
 }
diff -r 70593ef74836 -r 2fd8d3a2bd52 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:24:42 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 70593ef74836 -r 2fd8d3a2bd52 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:24:42 2009 -0400
@@ -79,6 +79,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 70593ef74836 -r 2fd8d3a2bd52 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:24:42 2009 -0400
@@ -124,6 +124,7 @@ raw_mailbox_open_input(struct mail_stora
 		return -1;
 	}
 	*input_r = i_stream_create_fd(fd, MAIL_READ_BLOCK_SIZE, TRUE);
+	i_stream_set_init_buffer_size(*input_r, MAIL_READ_BLOCK_SIZE);
 	return 0;
 }
 


More information about the dovecot-cvs mailing list