dovecot-2.0: mbox: Return header MD5 allocated from mail's data ...
dovecot at dovecot.org
dovecot at dovecot.org
Fri Oct 30 00:47:55 EET 2009
details: http://hg.dovecot.org/dovecot-2.0/rev/635fda7ed49c
changeset: 10235:635fda7ed49c
user: Timo Sirainen <tss at iki.fi>
date: Thu Oct 29 18:47:50 2009 -0400
description:
mbox: Return header MD5 allocated from mail's data pool, not data stack.
diffstat:
1 file changed, 6 insertions(+), 1 deletion(-)
src/lib-storage/index/mbox/mbox-mail.c | 7 ++++++-
diffs (20 lines):
diff -r db1a9e0853f5 -r 635fda7ed49c src/lib-storage/index/mbox/mbox-mail.c
--- a/src/lib-storage/index/mbox/mbox-mail.c Thu Oct 29 18:21:34 2009 -0400
+++ b/src/lib-storage/index/mbox/mbox-mail.c Thu Oct 29 18:47:50 2009 -0400
@@ -153,10 +153,15 @@ mbox_mail_get_md5_header(struct index_ma
struct mbox_mailbox *mbox = (struct mbox_mailbox *)mail->ibox;
const void *ext_data;
+ if (mail->data.guid != NULL)
+ return mail->data.guid;
+
mail_index_lookup_ext(mail->trans->trans_view, mail->mail.mail.seq,
mbox->md5hdr_ext_idx, &ext_data, NULL);
if (ext_data != NULL && memcmp(ext_data, empty_md5, 16) != 0) {
- *value_r = binary_to_hex(ext_data, 16);
+ mail->data.guid = p_strdup(mail->data_pool,
+ binary_to_hex(ext_data, 16));
+ *value_r = mail->data.guid;
return TRUE;
} else {
return FALSE;
More information about the dovecot-cvs
mailing list