DOC: log: Add comments to specify when session's listener is defined or not
When a log message is emitted, The session's listener is always defined when the session's owner is an inbound connection while it is undefined for a health-check. It is not obvious. So, comments have been added to make it clear. This patch is related to the issue #1434.
This commit is contained in:
parent
d9e6b35701
commit
1ccbe12f4a
|
@ -2117,6 +2117,7 @@ int sess_build_logline(struct session *sess, struct stream *s, char *dst, size_t
|
|||
case LOG_FMT_CLIENTPORT: // %cp
|
||||
addr = (s ? si_src(&s->si[0]) : sess_src(sess));
|
||||
if (addr) {
|
||||
/* sess->listener is always defined when the session's owner is an inbound connections */
|
||||
if (addr->ss_family == AF_UNIX)
|
||||
ret = ltoa_o(sess->listener->luid, tmplog, dst + maxsize - tmplog);
|
||||
else
|
||||
|
@ -2147,6 +2148,7 @@ int sess_build_logline(struct session *sess, struct stream *s, char *dst, size_t
|
|||
case LOG_FMT_FRONTENDPORT: // %fp
|
||||
addr = (s ? si_dst(&s->si[0]) : sess_dst(sess));
|
||||
if (addr) {
|
||||
/* sess->listener is always defined when the session's owner is an inbound connections */
|
||||
if (addr->ss_family == AF_UNIX)
|
||||
ret = ltoa_o(sess->listener->luid, tmplog, dst + maxsize - tmplog);
|
||||
else
|
||||
|
@ -2319,6 +2321,8 @@ int sess_build_logline(struct session *sess, struct stream *s, char *dst, size_t
|
|||
if (iret == 0)
|
||||
goto out;
|
||||
tmplog += iret;
|
||||
|
||||
/* sess->listener may be undefined if the session's owner is a health-check */
|
||||
if (sess->listener && sess->listener->bind_conf->xprt == xprt_get(XPRT_SSL))
|
||||
LOGCHAR('~');
|
||||
if (tmp->options & LOG_OPT_QUOTE)
|
||||
|
|
Loading…
Reference in New Issue