]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Added connection.last_input_tv for more accuracy
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 10 Aug 2016 14:41:51 +0000 (17:41 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 10 Aug 2016 23:14:44 +0000 (02:14 +0300)
src/lib/connection.c
src/lib/connection.h

index 718faceafaabcf09d5baf438a9ba0eaa073ed36f..69cd8d556b96e45da96329bcfba18e69a63f834e 100644 (file)
@@ -292,6 +292,7 @@ int connection_client_connect(struct connection *conn)
 void connection_disconnect(struct connection *conn)
 {
        conn->last_input = 0;
+       memset(&conn->last_input_tv, 0, sizeof(conn->last_input_tv));
        if (conn->to != NULL)
                timeout_remove(&conn->to);
        if (conn->io != NULL)
@@ -327,6 +328,7 @@ void connection_deinit(struct connection *conn)
 int connection_input_read(struct connection *conn)
 {
        conn->last_input = ioloop_time;
+       conn->last_input_tv = ioloop_timeval;
        if (conn->to != NULL)
                timeout_reset(conn->to);
 
index 3d32ca353663f60c39f182e236bfc610d13adf70..5619840609c27a3c5b395ff7bd1dde4214ce2931 100644 (file)
@@ -80,6 +80,7 @@ struct connection {
 
        struct timeout *to;
        time_t last_input;
+       struct timeval last_input_tv;
 
        /* for IP client: */
        struct ip_addr ip;