Mercurial > dovecot > core-2.2
changeset 784:2a6cc4f0c3c6 HEAD
Fixed a unnecessarily large data stack usage when indexing new mails.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 16 Dec 2002 05:27:35 +0200 |
parents | d826ab8c8d62 |
children | d96cbba73a8b |
files | src/lib-index/maildir/maildir-sync.c src/lib-index/mbox/mbox-append.c |
diffstat | 2 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-index/maildir/maildir-sync.c Mon Dec 16 05:26:55 2002 +0200 +++ b/src/lib-index/maildir/maildir-sync.c Mon Dec 16 05:27:35 2002 +0200 @@ -156,10 +156,12 @@ { HashAppendContext *ctx = context; + t_push(); if (!maildir_index_append_file(ctx->index, ctx->dir, value)) { ctx->failed = TRUE; hash_foreach_stop(); } + t_pop(); } static int maildir_index_append_files(MailIndex *index, const char *dir,
--- a/src/lib-index/mbox/mbox-append.c Mon Dec 16 05:26:55 2002 +0200 +++ b/src/lib-index/mbox/mbox-append.c Mon Dec 16 05:27:35 2002 +0200 @@ -112,6 +112,8 @@ int mbox_index_append(MailIndex *index, IStream *input) { + int ret; + if (input->v_offset == input->v_size) { /* no new data */ return TRUE; @@ -138,7 +140,11 @@ if (input->v_offset == input->v_size) break; - if (!mbox_index_append_next(index, input)) + t_push(); + ret = mbox_index_append_next(index, input); + t_pop(); + + if (!ret) return FALSE; }