mirror of
https://github.com/haproxy/haproxy.git
synced 2026-02-15 16:47:57 -05: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
1 changed files with 1 additions and 1 deletions
|
|
@ -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 a new issue