mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-18 19:56:59 +00:00
MINOR: logs: Use session idle duration when no stream is provided
When a log message is emitted from the session, using sess_log() function, there is no stream available. In this case, instead of deducing the idle duration from the accept date, we use the one provided by the session. 0 is used if it is undefined (i.e set to -1).
This commit is contained in:
parent
42849b047a
commit
dd78921c66
@ -2132,7 +2132,7 @@ int sess_build_logline(struct session *sess, struct stream *s, char *dst, size_t
|
||||
tmp_strm_log.tv_accept = sess->tv_accept;
|
||||
tmp_strm_log.accept_date = sess->accept_date;
|
||||
tmp_strm_log.t_handshake = sess->t_handshake;
|
||||
tmp_strm_log.t_idle = tv_ms_elapsed(&sess->tv_accept, &now) - sess->t_handshake;
|
||||
tmp_strm_log.t_idle = (sess->t_idle >= 0 ? sess->t_idle : 0);
|
||||
tv_zero(&tmp_strm_log.tv_request);
|
||||
tmp_strm_log.t_queue = -1;
|
||||
tmp_strm_log.t_connect = -1;
|
||||
|
Loading…
Reference in New Issue
Block a user