Skip to content

Commit

Permalink
lib: Added connection.connect_started/finished timestamps.
Browse files Browse the repository at this point in the history
  • Loading branch information
sirainen authored and GitLab committed Aug 11, 2016
1 parent 22140eb commit 2c5c70e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/connection.c
Expand Up @@ -153,6 +153,7 @@ static void connection_client_connected(struct connection *conn, bool success)
{
i_assert(conn->list->set.client);

conn->connect_finished = ioloop_timeval;
if (success)
connection_init_streams(conn);
if (conn->list->v.client_connected != NULL)
Expand Down Expand Up @@ -274,6 +275,7 @@ int connection_client_connect(struct connection *conn)
if (fd == -1)
return -1;
conn->fd_in = conn->fd_out = fd;
conn->connect_started = ioloop_timeval;

if (conn->port != 0 ||
conn->list->set.delayed_unix_client_connected_callback) {
Expand Down
2 changes: 2 additions & 0 deletions src/lib/connection.h
Expand Up @@ -81,6 +81,8 @@ struct connection {
struct timeout *to;
time_t last_input;
struct timeval last_input_tv;
struct timeval connect_started;
struct timeval connect_finished;

/* for IP client: */
struct ip_addr ip;
Expand Down

0 comments on commit 2c5c70e

Please sign in to comment.