Skip to content

Commit

Permalink
auth: Add event with category "auth" to struct auth_client_connection.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey-Kitov authored and cmouse committed Aug 7, 2018
1 parent c903a54 commit b2f1135
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/auth/auth-client-connection.c
Expand Up @@ -338,6 +338,10 @@ void auth_client_connection_create(struct auth *auth, int fd,
conn->connect_uid = ++connect_uid_counter;
conn->login_requests = login_requests;
conn->token_auth = token_auth;
conn->event = event_create(NULL);
if (auth->set->debug)
event_set_forced_debug(conn->event, TRUE);
event_add_category(conn->event, &event_category_auth);
random_fill(conn->cookie, sizeof(conn->cookie));

conn->fd = fd;
Expand Down Expand Up @@ -428,6 +432,7 @@ static void auth_client_connection_unref(struct auth_client_connection **_conn)
if (--conn->refcount > 0)
return;

event_unref(&conn->event);
i_stream_unref(&conn->input);
o_stream_unref(&conn->output);
i_free(conn);
Expand Down
1 change: 1 addition & 0 deletions src/auth/auth-client-connection.h
Expand Up @@ -6,6 +6,7 @@
struct auth_client_connection {
struct auth_client_connection *prev, *next;
struct auth *auth;
struct event *event;
int refcount;

int fd;
Expand Down

0 comments on commit b2f1135

Please sign in to comment.