dovecot-1.2: o_stream_send_istream(): Make sure istream->eof get...

dovecot at dovecot.org dovecot at dovecot.org
Tue May 19 20:37:52 EEST 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/3442cd45b502
changeset: 9061:3442cd45b502
user:      Timo Sirainen <tss at iki.fi>
date:      Tue May 19 13:36:33 2009 -0400
description:
o_stream_send_istream(): Make sure istream->eof gets set after sending everything with sendfile().

diffstat:

1 file changed, 4 insertions(+)
src/lib/ostream-file.c |    4 ++++

diffs (14 lines):

diff -r 46c9e3364d81 -r 3442cd45b502 src/lib/ostream-file.c
--- a/src/lib/ostream-file.c	Tue May 19 13:34:54 2009 -0400
+++ b/src/lib/ostream-file.c	Tue May 19 13:36:33 2009 -0400
@@ -632,6 +632,10 @@ static off_t io_stream_sendfile(struct o
 	} while ((uoff_t)ret != send_size);
 
 	i_stream_seek(instream, v_offset);
+	if (ret == 0) {
+		/* we should be at EOF, verify it by reading instream */
+		(void)i_stream_read(instream);
+	}
 	return ret < 0 ? -1 : (off_t)(instream->v_offset - start_offset);
 }
 


More information about the dovecot-cvs mailing list