]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
login-common: Report proxy-idle value as microseconds
authorKarl Fleischmann <karl.fleischmann@open-xchange.com>
Tue, 15 Nov 2022 15:25:56 +0000 (16:25 +0100)
committerKarl Fleischmann <karl.fleischmann@open-xchange.com>
Tue, 22 Nov 2022 07:48:41 +0000 (08:48 +0100)
To be consistent with other event attributes this value should be
reported as microseconds instead of seconds.

src/login-common/login-proxy.c

index a8b1349770218c59555061e3b1f4d6a157a79ab2..061a279cd72f1e8cdd3be1b34f6f44710520a68d 100644 (file)
@@ -654,8 +654,10 @@ login_proxy_free_full(struct login_proxy **_proxy, const char *log_msg,
                set_name("proxy_session_finished");
 
        if (proxy->detached) {
+               struct timeval proxy_tv = proxy_last_io_timeval(proxy);
+               intmax_t idle_usecs = timeval_diff_usecs(&ioloop_timeval, &proxy_tv);
                i_assert(proxy->connected);
-               e->add_int("idle_secs", ioloop_time - proxy_last_io(proxy));
+               e->add_int("idle_usecs", idle_usecs);
                e->add_int("bytes_in", proxy->server_output->offset);
                e->add_int("bytes_out", proxy->client_output->offset);
        }