]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Fix file_size field in mail_cache_purge_finished event
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 31 Aug 2020 14:23:05 +0000 (17:23 +0300)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 3 Sep 2020 15:31:01 +0000 (18:31 +0300)
It used to be 32 always.

src/lib-index/mail-cache-purge.c

index 8ce515f83817e413a9c8e832361e8dceb66256c3..f2d1b14a0b767c1bfcb60835df5118e2d5bb5746 100644 (file)
@@ -340,6 +340,7 @@ mail_cache_copy(struct mail_cache *cache, struct mail_index_transaction *trans,
        buffer_free(&ctx.buffer);
        buffer_free(&ctx.field_seen);
 
+       *file_size_r = output->offset;
        (void)o_stream_seek(output, 0);
        o_stream_nsend(output, &hdr, sizeof(hdr));
 
@@ -352,7 +353,6 @@ mail_cache_copy(struct mail_cache *cache, struct mail_index_transaction *trans,
                array_free(ext_offsets);
                return -1;
        }
-       *file_size_r = output->offset;
        o_stream_destroy(&output);
 
        if (cache->index->fsync_mode == FSYNC_MODE_ALWAYS) {