]> git.ipfire.org Git - thirdparty/haproxy.git/commit
CLEANUP: lists/tree-wide: rename some list operations to avoid some confusion
authorWilly Tarreau <w@1wt.eu>
Wed, 21 Apr 2021 05:32:39 +0000 (07:32 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 21 Apr 2021 07:20:17 +0000 (09:20 +0200)
commit2b71810cb3a45c8a52537a72ff0198fa6ae298b7
tree79a09dc08dab755c19afb0369f0a8374c6da7aea
parent3b9cdf1cb765d06ec9e0e6d099def245b330f12f
CLEANUP: lists/tree-wide: rename some list operations to avoid some confusion

The current "ADD" vs "ADDQ" is confusing because when thinking in terms
of appending at the end of a list, "ADD" naturally comes to mind, but
here it does the opposite, it inserts. Several times already it's been
incorrectly used where ADDQ was expected, the latest of which was a
fortunate accident explained in 6fa922562 ("CLEANUP: stream: explain
why we queue the stream at the head of the server list").

Let's use more explicit (but slightly longer) names now:

   LIST_ADD        ->       LIST_INSERT
   LIST_ADDQ       ->       LIST_APPEND
   LIST_ADDED      ->       LIST_INLIST
   LIST_DEL        ->       LIST_DELETE

The same is true for MT_LISTs, including their "TRY" variant.
LIST_DEL_INIT keeps its short name to encourage to use it instead of the
lazier LIST_DELETE which is often less safe.

The change is large (~674 non-comment entries) but is mechanical enough
to remain safe. No permutation was performed, so any out-of-tree code
can easily map older names to new ones.

The list doc was updated.
83 files changed:
addons/51degrees/51d.c
addons/ot/include/define.h
addons/ot/src/conf.c
addons/ot/src/scope.c
addons/wurfl/wurfl.c
contrib/mod_defender/include/haproxy/list.h
contrib/mod_defender/spoa.c
contrib/modsecurity/include/haproxy/list.h
contrib/modsecurity/spoa.c
contrib/spoa_example/include/mini-clist.h
contrib/spoa_example/spoa.c
doc/internals/list.fig
doc/internals/list.png [new file with mode: 0644]
include/haproxy/applet.h
include/haproxy/channel.h
include/haproxy/connection.h
include/haproxy/http_rules.h
include/haproxy/list.h
include/haproxy/listener.h
include/haproxy/pool.h
include/haproxy/session.h
include/haproxy/shctx.h
include/haproxy/stream.h
include/haproxy/task.h
include/haproxy/tcpcheck.h
include/haproxy/trace.h
include/haproxy/xprt_quic.h
src/acl.c
src/action.c
src/arg.c
src/backend.c
src/cache.c
src/cfgparse-listen.c
src/cfgparse-ssl.c
src/cfgparse.c
src/check.c
src/cli.c
src/dns.c
src/extcheck.c
src/fcgi-app.c
src/filters.c
src/flt_http_comp.c
src/flt_spoe.c
src/haproxy.c
src/hlua.c
src/http_act.c
src/http_htx.c
src/init.c
src/listener.c
src/log.c
src/lru.c
src/mailers.c
src/map.c
src/mux_fcgi.c
src/mux_h1.c
src/mux_h2.c
src/mworker-prog.c
src/mworker.c
src/pattern.c
src/peers.c
src/pool.c
src/protocol.c
src/proxy.c
src/quic_sock.c
src/resolvers.c
src/ring.c
src/sample.c
src/server.c
src/shctx.c
src/signal.c
src/sink.c
src/ssl_ckch.c
src/ssl_crtlist.c
src/ssl_sock.c
src/stats.c
src/stream.c
src/task.c
src/tcp_rules.c
src/tcpcheck.c
src/tools.c
src/vars.c
src/xprt_quic.c
tests/unit/test-list.c