]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: log: optimizing tmp->type handling in sess_build_logline()
authorAurelien DARRAGON <adarragon@haproxy.com>
Tue, 30 Apr 2024 13:52:57 +0000 (15:52 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Fri, 3 May 2024 14:48:21 +0000 (16:48 +0200)
commit48e0efb00bd5a81c6f093f7d7561888e7ef2c44d
tree6873d120986335fb54c17d42a2d5ac7ed21ad764
parent437062255e340e1f0ebd96338e8fe2d8e77086df
MEDIUM: log: optimizing tmp->type handling in sess_build_logline()

Instead of chaining 2 switchcases and performing encoding checks for all
nodes let's actually split the logic in 2: first handle simple node types
(text/separator), and then handle dynamic node types (tag, expr). Encoding
options are only evaluated for dynamic node types.

Also, last_isspace is always set to 0 after next_fmt label, since next_fmt
label is only used for dynamic nodes, thus != LOG_FMT_SEPARATOR.

Since LF_NODE_WITH_OPT() macro (which was introduced recently) is now
unused, let's get rid of it.

No functional change should be expected.

(Use diff -w to check patch changes since reindentation makes the patch
look heavy, but in fact it remains fairly small)
include/haproxy/log-t.h
src/log.c