changeset 2635:e69519ea4682 HEAD

Make sure we disconnect if mail input is finished unexpectedly.
author Timo Sirainen <tss@iki.fi>
date Thu, 16 Sep 2004 18:03:21 +0300
parents b847d8650282
children ff227b5c625d
files src/imap/imap-fetch-body.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/imap/imap-fetch-body.c	Thu Sep 16 17:59:29 2004 +0300
+++ b/src/imap/imap-fetch-body.c	Thu Sep 16 18:03:21 2004 +0300
@@ -251,6 +251,13 @@
 		ctx->cur_append_eoh = FALSE;
 	}
 
+	if (ctx->cur_offset != ctx->cur_size && ret == 0 &&
+	    ctx->cur_input->eof) {
+		/* Input stream gave less data than expected */
+		o_stream_close(ctx->client->output);
+		return -1;
+	}
+
 	return ctx->cur_offset == ctx->cur_size;
 }