changeset 15911:b0682d64a990

imap: Added assert+comment to give easier to understand error.
author Timo Sirainen <tss@iki.fi>
date Sun, 24 Feb 2013 14:59:54 +0200
parents b787cf83bca8
children 94ebc333c47a
files src/imap/cmd-append.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/imap/cmd-append.c	Sun Feb 24 14:58:32 2013 +0200
+++ b/src/imap/cmd-append.c	Sun Feb 24 14:59:54 2013 +0200
@@ -230,6 +230,9 @@
 		client_send_storage_error(cmd, ctx->storage);
 		ret = -1;
 	} else {
+		/* all the input must be consumed, so istream-chain's read()
+		   unreferences the stream and we can free its parent mail */
+		i_assert(!i_stream_have_bytes_left(mpresult.input));
 		ret = 0;
 	}
 	imap_msgpart_url_free(&mpurl);