]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: log: use the new generic fd_write_frag_line() function
authorWilly Tarreau <w@1wt.eu>
Fri, 30 Aug 2019 12:05:35 +0000 (14:05 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 30 Aug 2019 13:07:25 +0000 (15:07 +0200)
commitd52a7f8c8df473df53392652643bfde78d31ec9e
tree71eb25403bd89c053b2cd6ac3cc8abb7c7078299
parent7e9776ad7b81cff4f0c1ff3781bc6388323a3655
MEDIUM: log: use the new generic fd_write_frag_line() function

When logging to a file descriptor, we'd rather use the unified
fd_write_frag_line() which uses the FD's lock than perform the
writev() ourselves and use a per-server lock, because if several
loggers point to the same output (e.g. stdout) they are still
not locked and their logs may interleave. The function above
instead relies on the fd's lock so this is safer and will even
protect against concurrent accesses from other areas (e.g traces).
The function also deals with the FD's non-blocking mode so we do
not have to keep specific code for this anymore in the logs.
src/log.c