[dovecot-cvs] dovecot/src/imap imap-fetch-body.c,1.8,1.9

cras at dovecot.org cras at dovecot.org
Thu Sep 16 18:03:23 EEST 2004


Update of /var/lib/cvs/dovecot/src/imap
In directory talvi:/tmp/cvs-serv26432/imap

Modified Files:
	imap-fetch-body.c 
Log Message:
Make sure we disconnect if mail input is finished unexpectedly.



Index: imap-fetch-body.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/imap-fetch-body.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- imap-fetch-body.c	4 Sep 2004 10:29:52 -0000	1.8
+++ imap-fetch-body.c	16 Sep 2004 15:03:21 -0000	1.9
@@ -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;
 }
 



More information about the dovecot-cvs mailing list