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

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


details:   http://hg.dovecot.org/dovecot-2.0/rev/a5bc58832be9
changeset: 9326:a5bc58832be9
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 c96abc68b115 -r a5bc58832be9 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
@@ -730,6 +730,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