]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: http: add infrastructure to choose status codes for err / fail
authorWilly Tarreau <w@1wt.eu>
Wed, 10 Jan 2024 17:36:12 +0000 (18:36 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 11 Jan 2024 14:10:08 +0000 (15:10 +0100)
commit3c135569c54d3e0c4b9303974ef3d910d0b5de1a
treef15260ddda4436a9d65e80e95e9b523ad0a912e2
parent59c01f1091c3f7d7c72d7e456ad2b9d70ca46081
MINOR: http: add infrastructure to choose status codes for err / fail

At the moment, http_err_cnt and http_fail_cnt are incremented on a
well-defined set of status codes, which are checked at various places.
Over time, there have been some complains about 404, 401 or 407
triggering errors, or 500 triggering failures in SOAP environments
for example. With a small bit field that fits in a cache line we
can match the presence of a status code from 100 to 599, so that
remains cheap.

This patch adds two such bit fields, one per code class, and the
accompanying functions to set/clear/test the codes. The arrays are
preset at boot time. For now they are not used and it's not possible
to adjust them.
include/haproxy/http.h
src/http.c