mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-24 07:11:20 +02:00
BUG: fix httplog trailing LF
commit a1cc3811 introduced an undesirable \0\n ending on HTTP log messages. This is because of an extra character count passed to __send_log() which causes the LF to be appended past the \0. Some syslog daemons thus log an extra empty line. The fix is obvious. Fix the function comments to remind what they expect on their input. This is past 1.5-dev7 regression so there's no backport needed.
This commit is contained in:
parent
f09c6603d3
commit
53bf6af3f9
@ -519,7 +519,7 @@ char *hdr_log(char *dst)
|
||||
|
||||
/*
|
||||
* This function adds a header to the message and sends the syslog message
|
||||
* using a printf format string
|
||||
* using a printf format string. It expects an LF-terminated message.
|
||||
*/
|
||||
void send_log(struct proxy *p, int level, const char *format, ...)
|
||||
{
|
||||
@ -546,6 +546,7 @@ void send_log(struct proxy *p, int level, const char *format, ...)
|
||||
/*
|
||||
* This function sends a syslog message.
|
||||
* It doesn't care about errors nor does it report them.
|
||||
* It overrides the last byte (message[size-1]) with an LF character.
|
||||
*/
|
||||
void __send_log(struct proxy *p, int level, char *message, size_t size)
|
||||
{
|
||||
|
@ -1241,7 +1241,7 @@ out:
|
||||
if (tmplog == NULL) // if previous error
|
||||
tmplog = logline + MAX_SYSLOG_LEN - 1;
|
||||
|
||||
__send_log(prx_log, level, logline, tmplog - logline + 2);
|
||||
__send_log(prx_log, level, logline, tmplog - logline + 1);
|
||||
s->logs.logwait = 0;
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user