]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: ring/sink: use applet_append_line()/syslog_applet_append_event() for readers
authorWilly Tarreau <w@1wt.eu>
Tue, 27 Feb 2024 14:55:26 +0000 (15:55 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 25 Mar 2024 17:34:19 +0000 (17:34 +0000)
commit8022ae326c31b6a05a73f9cdab575d2d8e553673
tree2354c152dfe9771a8020b31b9ce0d2638ec3e4aa
parent201c706330c8fa248a052d5e22a1ba0259f8bf00
MEDIUM: ring/sink: use applet_append_line()/syslog_applet_append_event() for readers

The rink reader code was duplicated as-is in 2.2 for the ring forwarding
code in commits 494c505703 ("MEDIUM: ring: add server statement to forward
messages from a ring") and 975564784f ("MEDIUM: ring: add new srv statement
to support octet counting forward") (which only differs by using a prefix
instead of a suffix to delimit messages).

Unfortunately, that makes it almost impossible to rework the core ring
code because all these parts rely on it. This first commit aims at
restoring a common structure for the core loop by just calling a distinct
function based on the use case. The functions are either
applet_append_line() when a whole line is to be emitted followed by an LF
character, or syslog_applet_appent_event() when trying to send a TCP
syslog line prepended with its size in decimal.

There is no functional change beyond this.
src/ring.c
src/sink.c