]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-ldap: struct ldap_client_settings - Add event
authorMarco Bettini <marco.bettini@open-xchange.com>
Tue, 11 Oct 2022 13:46:53 +0000 (13:46 +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
src/lib-ldap/ldap-client.h
src/lib-ldap/ldap-connection.c
src/lib-ldap/ldap-private.h

index 692fef6f934d460735553a99c8a7858dacf9ee3f..648a4f8f043c09a5e4014b2c36522ab643a07d4a 100644 (file)
@@ -167,6 +167,7 @@ int dict_ldap_connect(struct ldap_dict *dict, const char **error_r)
        set.debug = dict->set->debug;
        set.require_ssl = dict->set->require_ssl;
        set.start_tls = dict->set->start_tls;
+       set.event_parent = dict->event;
        return ldap_client_init(&set, &dict->client, error_r);
 }
 
index 1a231ddff2396fd1aeb6087ea1bb94b56e6e99bd..91ed0af2aaa16dd4f443277760e543d471e3e80b 100644 (file)
@@ -25,6 +25,7 @@ struct ldap_client_settings {
        const char *bind_dn;
        const char *password;
 
+       struct event *event_parent;
        const struct ssl_iostream_settings *ssl_set;
 
        unsigned int timeout_secs;
index 95a91ea331a82a95fdeb8c659a7159d0addae5b1..66e89f0ddab1dc658954f7c7e8e08c5b2ce2f19a 100644 (file)
@@ -34,6 +34,7 @@ void ldap_connection_deinit(struct ldap_connection **_conn)
                                       aqueue_idx(conn->request_queue, i));
                timeout_remove(&req->to_abort);
        }
+       event_unref(&conn->event);
        pool_unref(&conn->pool);
 }
 
@@ -147,6 +148,7 @@ int ldap_connection_init(struct ldap_client *client,
        pool_t pool = pool_alloconly_create("ldap connection", 1024);
        struct ldap_connection *conn = p_new(pool, struct ldap_connection, 1);
        conn->pool = pool;
+       conn->event = event_create(set->event_parent);
 
        conn->client = client;
        conn->set = *set;
index 9f3b20c5aec31314f10e85abcad1eb241ac6a637..ec40f1c550b3302e4deea40d5975b17e03d1e4e9 100644 (file)
@@ -45,6 +45,7 @@ struct ldap_op_queue_entry {
 
 struct ldap_connection {
        pool_t pool;
+       struct event *event;
        struct ldap_client *client;
 
        LDAP *conn;