struct quota {
struct mail_user *user;
struct quota_settings *set;
+ struct event *event;
ARRAY(struct quota_root *) roots;
ARRAY(struct mail_namespace *) namespaces;
pool_t pool;
ARRAY(struct quota_root_settings *) root_sets;
+ struct event *event;
enum quota_alloc_result (*test_alloc)(
struct quota_transaction_context *ctx, uoff_t size,
const char **error_r);
pool = pool_alloconly_create("quota settings", 2048);
quota_set = p_new(pool, struct quota_settings, 1);
quota_set->pool = pool;
+ quota_set->event = event_create(user->event);
quota_set->test_alloc = quota_default_test_alloc;
quota_set->debug = user->mail_debug;
quota_set->quota_exceeded_msg =
&error) < 0) {
*error_r = t_strdup_printf("Invalid quota root %s: %s",
root_name, error);
+ event_unref("a_set->event);
pool_unref(&pool);
return -1;
}
}
if (quota_set->max_mail_size == 0 &&
array_count("a_set->root_sets) == 0) {
+ event_unref("a_set->event);
pool_unref(&pool);
return 0;
}
*_quota_set = NULL;
+ event_unref("a_set->event);
pool_unref("a_set->pool);
}
int ret;
quota = i_new(struct quota, 1);
+ quota->event = event_create(user->event);
+ event_set_forced_debug(quota->event, quota_set->debug);
quota->user = user;
quota->set = quota_set;
i_array_init("a->roots, 8);
array_free("a->roots);
array_free("a->namespaces);
+ event_unref("a->event);
i_free(quota);
}