]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: fd: add fd_write_frag_line() to send a fragmented line to an fd
authorWilly Tarreau <w@1wt.eu>
Tue, 27 Aug 2019 09:08:17 +0000 (11:08 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 27 Aug 2019 15:14:19 +0000 (17:14 +0200)
commit931d8b79a88b20573a04c3f11866e934a58c9b34
treeb964f6e062b9e0e738b8150dd611b023446ef064
parentb88d2317732f0797f29a745e956bb1c7f23e41f6
MINOR: fd: add fd_write_frag_line() to send a fragmented line to an fd

Currently both logs and event sinks may use a file descriptor to
atomically emit some output contents. The two may use the same FD though
nothing is done to make sure they use the same lock. Also there is quite
some redundancy between the two. Better make a specific function to send
a fragmented message to a file descriptor which will take care of the
locking via the fd's lock. The function is also able to truncate a
message and to enforce addition of a trailing LF when building the
output message.
include/proto/fd.h
include/types/fd.h
src/fd.c