changeset 2789:c6f128e5520b HEAD

input->eof && o_stream_send_istream() == 0 isn't a correct way to check if all is sent. Use i_stream_have_bytes_left() instead.
author Timo Sirainen <tss@iki.fi>
date Wed, 20 Oct 2004 20:04:27 +0300
parents f322b24da429
children 02c0b8d532c2
files src/imap/imap-fetch-body.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/imap/imap-fetch-body.c	Wed Oct 20 20:03:23 2004 +0300
+++ b/src/imap/imap-fetch-body.c	Wed Oct 20 20:04:27 2004 +0300
@@ -239,8 +239,8 @@
 		ctx->cur_append_eoh = FALSE;
 	}
 
-	if (ctx->cur_offset != ctx->cur_size && ret == 0 &&
-	    ctx->cur_input->eof) {
+	if (ctx->cur_offset != ctx->cur_size &&
+	    !i_stream_have_bytes_left(ctx->cur_input)) {
 		/* Input stream gave less data than expected */
 		o_stream_close(ctx->client->output);
 		return -1;