]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
quota: Retain quota settings longer
authorAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 10 Dec 2025 06:56:37 +0000 (08:56 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Wed, 17 Dec 2025 12:31:53 +0000 (12:31 +0000)
This simplifies following commit

src/plugins/quota/quota-private.h
src/plugins/quota/quota.c

index d3c91ab6c96d7bcefae490bd7ad896eee4d3a85e..4461dc97857ad831e0c9abcfafa82c1ad4b5b570 100644 (file)
@@ -13,6 +13,7 @@ extern unsigned int quota_module_id;
 struct quota {
        struct mail_user *user;
        struct event *event;
+       const struct quota_settings *set;
 
        /* Global quota roots. These are filled when initializing the user.
           These quota roots will be used only for private namespaces. */
index 76a9d3068ef9be6a9f95405bd4c608466089345b..677733d8dea8f9735d83a35ae7c8dfead20a78c9 100644 (file)
@@ -282,6 +282,8 @@ int quota_init(struct mail_user *user, struct quota **quota_r,
        event_set_append_log_prefix(quota->event, "quota: ");
        quota->user = user;
        quota->test_alloc = quota_default_test_alloc;
+       quota->set = set;
+
        i_array_init(&quota->global_private_roots, 8);
        i_array_init(&quota->all_roots, 8);
 
@@ -300,7 +302,6 @@ int quota_init(struct mail_user *user, struct quota **quota_r,
                                array_push_back(&quota->global_private_roots, &root);
                }
        }
-       settings_free(set);
        *quota_r = quota;
        return 0;
 }
@@ -320,6 +321,7 @@ void quota_deinit(struct quota **_quota)
 
        array_free(&quota->global_private_roots);
        array_free(&quota->all_roots);
+       settings_free(quota->set);
        event_unref(&quota->event);
        i_free(quota);
 }