changeset 22125:fbfb7adfd428

lib-storage: Make sure istream-mail doesn't replace an existing storage error I'm not aware of it actually having broken anything, so this is just for extra safety.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Mon, 05 Jun 2017 20:14:54 +0300
parents 1321733273ba
children 4bbdc9bb178b
files src/lib-storage/index/istream-mail.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/istream-mail.c	Mon Jun 05 20:12:43 2017 +0300
+++ b/src/lib-storage/index/istream-mail.c	Mon Jun 05 20:14:54 2017 +0300
@@ -23,11 +23,15 @@
 	if (mstream->expected_size != (uoff_t)-1)
 		return TRUE;
 
+	/* make sure this call doesn't change any existing error message,
+	   just in case there's already something important in it. */
+	mail_storage_last_error_push(mail->box->storage);
 	orig_lookup_abort = mail->lookup_abort;
 	mail->lookup_abort = MAIL_LOOKUP_ABORT_NOT_IN_CACHE;
 	if (mail_get_physical_size(mail, &mstream->expected_size) < 0)
 		mstream->expected_size = (uoff_t)-1;
 	mail->lookup_abort = orig_lookup_abort;
+	mail_storage_last_error_pop(mail->box->storage);
 	return mstream->expected_size != (uoff_t)-1;
 }