BUG/MINOR: log: Wrong log format initialization.
authorFrédéric Lécaille <flecaille@haproxy.com>
Tue, 14 May 2019 08:57:58 +0000 (10:57 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 14 May 2019 09:12:00 +0000 (11:12 +0200)
commit90a10aeb65d115c268ff9aa0f5ad39a29a1a35b3
tree187fd8763960373d398abf0fe9599718b310c2f1
parent8bdb5c9bb4bd499e4c9f55e5991ad7cd2d2ad7f4
BUG/MINOR: log: Wrong log format initialization.

This patch fixes an issue introduced by 0bad840b commit
"MINOR: log: Extract some code to send syslog messages" which leaded
to wrong log format variable initializations at least for "short" and "raw" format.
This commit skipped the cases where even if passed to __do_send_log(), the
syslog tag and syslog pid string must not be used to format the log message
with "short" and "raw". This is done iniatilizing "tag_max" and "pid_max"
variables (the lengths of the tag and pid strings) to 0, then updating to them to
the length of the tag and pid strings passed as variables to __do_send_log()
depending on the log format and in every cases using this length for the iovec
variable used to send() the log.

This bug is specific to 2.0.
src/log.c