Skip to content

Commit

Permalink
imap-urlauth: Add event with "imap-urlauth" category to struct client…
Browse files Browse the repository at this point in the history
… of imap-urlauth
  • Loading branch information
Sergey-Kitov authored and cmouse committed Aug 7, 2018
1 parent b103d44 commit 9db0b7b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/imap-urlauth/imap-urlauth-client.c
Expand Up @@ -38,6 +38,10 @@
#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;

Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/imap-urlauth/imap-urlauth-client.h
Expand Up @@ -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;
Expand Down

0 comments on commit 9db0b7b

Please sign in to comment.