]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Added connection.connect_started/finished timestamps.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 10 Aug 2016 14:44:26 +0000 (17:44 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 15 Aug 2016 13:14:27 +0000 (16:14 +0300)
src/lib/connection.c
src/lib/connection.h

index 69cd8d556b96e45da96329bcfba18e69a63f834e..2e433ba2b15bb93d5d3a6312a897ec79f48f1b8f 100644 (file)
@@ -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)
@@ -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) {
index 5619840609c27a3c5b395ff7bd1dde4214ce2931..5ac6c4d57d2fa3c0411c5f16bc9d282fd4e5f160 100644 (file)
@@ -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;