]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap-urlauth: Add event with "imap-urlauth" category to struct client of imap-urlauth
authorSergey Kitov <sergey.kitov@open-xchange.com>
Tue, 20 Mar 2018 07:52:38 +0000 (09:52 +0200)
committerAki Tuomi <aki.tuomi@dovecot.fi>
Tue, 7 Aug 2018 11:10:07 +0000 (14:10 +0300)
src/imap-urlauth/imap-urlauth-client.c
src/imap-urlauth/imap-urlauth-client.h

index 513b35c4bbffb971263c20124df1905fc43664af..e46ca69c2b750b3d3a174fa9f09e9ecc82aaeb69 100644 (file)
 #define IS_STANDALONE() \
         (getenv(MASTER_IS_PARENT_ENV) == NULL)
 
+struct event_category event_category_urlauth = {
+       .name = "imap-urlauth",
+};
+
 struct client *imap_urlauth_clients;
 unsigned int imap_urlauth_client_count;
 
@@ -62,6 +66,11 @@ int client_create(const char *service, const char *username,
        client->fd_ctrl = -1;
        client->set = set;
 
+       client->event = event_create(NULL);
+       if (set->mail_debug)
+               event_set_forced_debug(client->event, TRUE);
+       event_add_category(client->event, &event_category_urlauth);
+
        if (client_worker_connect(client) < 0) {
                i_free(client);
                return -1;
@@ -340,6 +349,8 @@ void client_destroy(struct client *client, const char *reason)
 
        fd_close_maybe_stdio(&client->fd_in, &client->fd_out);
 
+       event_unref(&client->event);
+
        i_free(client->username);
        i_free(client->service);
        array_free(&client->access_apps);
index 408c3bc90f64db6f779a7659eeee4a8df08e1bab..ada8407c745cdc23c6763cd163e8e2b82b601bcd 100644 (file)
@@ -18,6 +18,7 @@ struct client {
        struct ostream *output, *ctrl_output;
        struct istream *ctrl_input;
        struct timeout *to_idle;
+       struct event *event;
 
        char *username, *service;
        ARRAY_TYPE(const_string) access_apps;