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

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


details:   http://hg.dovecot.org/dovecot-1.1/rev/96d6f17cc540
changeset: 8279:96d6f17cc540
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 1bc39800415d -r 96d6f17cc540 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
@@ -631,6 +631,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