const struct mail_index_ext *ext;
const char *name, *error;
uint32_t ext_map_idx;
+ bool no_resize;
/* default to ignoring the following extension updates in case this
intro is corrupted */
ext_hdr.hdr_size = u->hdr_size;
ext_hdr.record_size = u->record_size;
ext_hdr.record_align = u->record_align;
+ no_resize = (u->flags & MAIL_TRANSACTION_EXT_INTRO_FLAG_NO_RESIZE) != 0;
/* make sure the header looks valid before doing anything with it */
if (mail_index_map_ext_hdr_check(&map->hdr, &ext_hdr,
/* exists already */
if (u->reset_id == ext->reset_id) {
/* check if we need to resize anything */
- sync_ext_resize(u, ext_map_idx, ctx);
+ if (!no_resize)
+ sync_ext_resize(u, ext_map_idx, ctx);
ctx->cur_ext_ignore = FALSE;
} else {
/* extension was reset and this transaction hadn't
intro->hdr_size = rext->hdr_size;
intro->record_size = rext->record_size;
intro->record_align = rext->record_align;
+ intro->flags = MAIL_TRANSACTION_EXT_INTRO_FLAG_NO_RESIZE;
intro->name_size = idx != (uint32_t)-1 ? 0 :
strlen(rext->name);
}
/* unsigned char data[]; */
};
+enum {
+ /* Ignore hdr_size, record_size and record_align */
+ MAIL_TRANSACTION_EXT_INTRO_FLAG_NO_RESIZE = 0x01
+};
+
struct mail_transaction_ext_intro {
/* old extension: set ext_id. don't set name.
new extension: ext_id = (uint32_t)-1. give name. */
uint32_t hdr_size;
uint16_t record_size;
uint16_t record_align;
- uint16_t unused_padding;
+ uint16_t flags;
uint16_t name_size;
/* unsigned char name[]; */
};