Skip to content

Commit

Permalink
lib-storage/index: Add a helper to cache pop3 order and uidl
Browse files Browse the repository at this point in the history
  • Loading branch information
Josef 'Jeff' Sipek authored and villesavolainen committed Nov 14, 2018
1 parent 63fd16b commit 8c14347
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/lib-storage/index/index-mail.c
Expand Up @@ -623,6 +623,20 @@ void index_mail_cache_add_idx(struct index_mail *mail, unsigned int field_idx,
}
}

void index_mail_cache_pop3_data(struct mail *_mail,
const char *uidl, uint32_t order)
{
struct index_mail *mail = INDEX_MAIL(_mail);

if (uidl != NULL)
index_mail_cache_add(mail, MAIL_CACHE_POP3_UIDL,
uidl, strlen(uidl));

if (order != 0)
index_mail_cache_add(mail, MAIL_CACHE_POP3_ORDER,
&order, sizeof(order));
}

static void parse_bodystructure_part_header(struct message_part *part,
struct message_header_line *hdr,
pool_t pool)
Expand Down
3 changes: 3 additions & 0 deletions src/lib-storage/index/index-mail.h
Expand Up @@ -266,6 +266,9 @@ void index_mail_cache_add(struct index_mail *mail, enum index_cache_field field,
void index_mail_cache_add_idx(struct index_mail *mail, unsigned int field_idx,
const void *data, size_t data_size);

void index_mail_cache_pop3_data(struct mail *_mail,
const char *uidl, uint32_t order);

struct istream *index_mail_cache_parse_init(struct mail *mail,
struct istream *input);
void index_mail_cache_parse_continue(struct mail *mail);
Expand Down

0 comments on commit 8c14347

Please sign in to comment.