dovecot-2.1: dbox: Metadata read buffer's size was supposed to b...

dovecot at dovecot.org dovecot at dovecot.org
Fri May 4 20:14:30 EEST 2012


details:   http://hg.dovecot.org/dovecot-2.1/rev/fa6662ab4df3
changeset: 14501:fa6662ab4df3
user:      Timo Sirainen <tss at iki.fi>
date:      Fri May 04 20:14:20 2012 +0300
description:
dbox: Metadata read buffer's size was supposed to be unlimited, not zero.
This was broken by 59f5238c6e61, which itself had fixed another bug.

diffstat:

 src/lib-storage/index/dbox-common/dbox-file.c  |  5 +++--
 src/lib-storage/index/dbox-multi/mdbox-purge.c |  6 ++++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diffs (45 lines):

diff -r 3689eced9381 -r fa6662ab4df3 src/lib-storage/index/dbox-common/dbox-file.c
--- a/src/lib-storage/index/dbox-common/dbox-file.c	Fri May 04 20:07:05 2012 +0300
+++ b/src/lib-storage/index/dbox-common/dbox-file.c	Fri May 04 20:14:20 2012 +0300
@@ -407,7 +407,7 @@
 
 	/* skip over the actual metadata */
 	buf_size = i_stream_get_max_buffer_size(file->input);
-	i_stream_set_max_buffer_size(file->input, 0);
+	i_stream_set_max_buffer_size(file->input, (size_t)-1);
 	while ((line = i_stream_read_next_line(file->input)) != NULL) {
 		if (*line == DBOX_METADATA_OLDV1_SPACE || *line == '\0') {
 			/* end of metadata */
@@ -657,7 +657,8 @@
 
 	ret = 0;
 	buf_size = i_stream_get_max_buffer_size(file->input);
-	i_stream_set_max_buffer_size(file->input, 0);
+	/* use unlimited line length for metadata */
+	i_stream_set_max_buffer_size(file->input, (size_t)-1);
 	while ((line = i_stream_read_next_line(file->input)) != NULL) {
 		if (*line == DBOX_METADATA_OLDV1_SPACE || *line == '\0') {
 			/* end of metadata */
diff -r 3689eced9381 -r fa6662ab4df3 src/lib-storage/index/dbox-multi/mdbox-purge.c
--- a/src/lib-storage/index/dbox-multi/mdbox-purge.c	Fri May 04 20:07:05 2012 +0300
+++ b/src/lib-storage/index/dbox-multi/mdbox-purge.c	Fri May 04 20:14:20 2012 +0300
@@ -107,7 +107,8 @@
 
 	o_stream_send(output, &meta_hdr, sizeof(meta_hdr));
 	buf_size = i_stream_get_max_buffer_size(file->input);
-	i_stream_set_max_buffer_size(file->input, 0);
+	/* use unlimited line length for metadata */
+	i_stream_set_max_buffer_size(file->input, (size_t)-1);
 	while ((line = i_stream_read_next_line(file->input)) != NULL) {
 		if (*line == '\0') {
 			/* end of metadata */
@@ -140,7 +141,8 @@
 		return ret;
 
 	buf_size = i_stream_get_max_buffer_size(file->input);
-	i_stream_set_max_buffer_size(file->input, 0);
+	/* use unlimited line length for metadata */
+	i_stream_set_max_buffer_size(file->input, (size_t)-1);
 	while ((line = i_stream_read_next_line(file->input)) != NULL) {
 		if (*line == '\0') {
 			/* end of metadata */


More information about the dovecot-cvs mailing list