dovecot-2.2: dbox: Metadata read buffer's size was supposed to b...
dovecot at dovecot.org
dovecot at dovecot.org
Sun May 20 03:26:35 EEST 2012
details: http://hg.dovecot.org/dovecot-2.2/rev/fa6662ab4df3
changeset: 14537: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