]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-dict-backend: struct ldap_dict - Add event
authorMarco Bettini <marco.bettini@open-xchange.com>
Tue, 11 Oct 2022 13:44:15 +0000 (13:44 +0000)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Wed, 26 Oct 2022 16:35:08 +0000 (16:35 +0000)
src/lib-dict-backend/dict-ldap.c

index e0ca9300fc7a4315a7187025e74095ac23d4a050..2142184cc92b511d63f4e3b6ba66285b28b684fa 100644 (file)
@@ -40,6 +40,7 @@ struct ldap_dict {
        enum ldap_scope scope;
 
        pool_t pool;
+       struct event *event;
 
        struct ldap_client *client;
 
@@ -237,16 +238,19 @@ int ldap_dict_init(struct dict *dict_driver, const char *uri,
        pool_t pool = pool_alloconly_create("ldap dict", 2048);
        struct ldap_dict *dict = p_new(pool, struct ldap_dict, 1);
        dict->pool = pool;
+       dict->event = event_create(NULL);
        dict->dict = *dict_driver;
        dict->uri = p_strdup(pool, uri);
        dict->set = dict_ldap_settings_read(pool, uri, error_r);
 
        if (dict->set == NULL) {
+               event_unref(&dict->event);
                pool_unref(&pool);
                return -1;
        }
 
        if (dict_ldap_connect(dict, error_r) < 0) {
+               event_unref(&dict->event);
                pool_unref(&pool);
                return -1;
        }
@@ -262,6 +266,7 @@ void ldap_dict_deinit(struct dict *dict)
        struct ldap_dict *ctx = (struct ldap_dict *)dict;
 
        ldap_client_deinit(&ctx->client);
+       event_unref(&dict->event);
        pool_unref(&ctx->pool);
 }