]> git.ipfire.org Git - thirdparty/haproxy.git/log
thirdparty/haproxy.git
14 months agoMINOR: log: add +bin logformat node option
Aurelien DARRAGON [Thu, 25 Apr 2024 14:29:01 +0000 (16:29 +0200)] 
MINOR: log: add +bin logformat node option

Support '+bin' option argument on logformat nodes to try to preserve
binary output type with binary sample expressions.

For this, we rely on the log/sink API which is capable of conveying binary
data since all related functions don't search for a terminating NULL byte
in provided log payload as they take a string pointer and a string length
as argument.

Example:
  log-format "%{+bin}o %[bin(00AABB)]"

Will produce:
  00aabb

(output was piped to `hexdump  -ve '1/1 "%.2x"'` to dump raw bytes as HEX
characters)

This should be used carefully, because many syslog endpoints don't expect
binary data (especially NULL bytes). This is mainly intended for use with
set-var-fmt actions or with ring/udp log endpoints that know how to deal
with such binary payloads.

Also, this option is only supported globally (for use with '%o'), it will
not have any effect when set on an individual node. (it makes no sense to
have binary data in the middle of log payload that was started without
binary data option)

14 months agoMINOR: log: add no_escape_map to bypass escape with _lf_encode_bytes()
Aurelien DARRAGON [Fri, 26 Apr 2024 12:23:43 +0000 (14:23 +0200)] 
MINOR: log: add no_escape_map to bypass escape with _lf_encode_bytes()

Providing no_escape_map as <map> argument to _lf_encode_bytes() function
will make the function skip escaping since the map is empty.

This is for convenience, as it might be useful to call lf_encode_chunk()
to encoding binary data without escaping it.

14 months agoMINOR: log: add LOG_OPT_NONE flag
Aurelien DARRAGON [Thu, 25 Apr 2024 14:24:56 +0000 (16:24 +0200)] 
MINOR: log: add LOG_OPT_NONE flag

Add LOG_OPT_NONE flag for default value. Flag is not explicitly used yet
but with way we make it official that 0 value means NONE.

14 months agoMINOR: log: postpone conversion for sample expressions in sess_build_logline()
Aurelien DARRAGON [Thu, 25 Apr 2024 14:20:11 +0000 (16:20 +0200)] 
MINOR: log: postpone conversion for sample expressions in sess_build_logline()

In sess_build_logline(), for sample expression nodes, instead of directly
calling sample_fetch_as_type(... SMP_T_STR), let's first process the
sample using sample_process(), and then proceed with the conversion to
str if required.

Doing so will allow us to implement type casting and preserving logic.

14 months agoMINOR: log: expose node typecast in lf_buildctx struct
Aurelien DARRAGON [Thu, 25 Apr 2024 16:52:57 +0000 (18:52 +0200)] 
MINOR: log: expose node typecast in lf_buildctx struct

Store node->typecast setting inside lf_buildctx struct so that encoding
functions may benefit from it.

14 months agoMEDIUM: log: lf_* build helpers now take a ctx argument
Aurelien DARRAGON [Mon, 22 Apr 2024 08:12:42 +0000 (10:12 +0200)] 
MEDIUM: log: lf_* build helpers now take a ctx argument

Add internal lf_buildctx struct that is only used inside
sess_build_logline() scope and is passed to lf_* log building helpers
to expose current building context. For now, node options and the in_text
counter are stored in the ctx struct. Thanks to this change, lf_* building
functions don't depend on a logformat_node struct pointer, and may be used
in a standalone manner as long as a build context is provided.

Also, global options are now handled explictly in sess_build_logline() to
make sure that global options are always considered even if they were not
duplicated on every nodes.

No functional change should be expected.

14 months agoMINOR: log: merge lf_encode_string() and lf_encode_chunk() logic
Aurelien DARRAGON [Fri, 26 Apr 2024 11:53:15 +0000 (13:53 +0200)] 
MINOR: log: merge lf_encode_string() and lf_encode_chunk() logic

lf_encode_string() and lf_encode_chunk() function are pretty similar. The
only difference is the stopping behavior, encode_chunk stops at a given
position while encode_string stops when encountering '\0'. Moreover,
both functions leverage tools.c encode helpers, but because of the
LOG_OPT_ESC option, they reimplement those helpers with added logic.

Instead of having to deal with code duplication which makes both functions
harder to maintain, let's define a _lf_encode_bytes() helper function
which satisfies lf_encode_string() and lf_encode_chunk() needs while
keeping the function as simple as possible.

_lf_encode_bytes() itself is made of multiple static inline helper
functions, in the attempt to keep checks outside of core loop for
better performance.

14 months agoMINOR: log: make all lf_* sess build helper static
Aurelien DARRAGON [Mon, 22 Apr 2024 08:18:18 +0000 (10:18 +0200)] 
MINOR: log: make all lf_* sess build helper static

There is no need to expose such functions since they are only involved in
the log building process that occurs inside sess_build_logline().

Making functions static and removing their public prototype to ease code
maintenance.

14 months agoMINOR: log: use LOG_VARTEXT_{START,END} to enclose text strings
Aurelien DARRAGON [Tue, 16 Apr 2024 09:17:55 +0000 (11:17 +0200)] 
MINOR: log: use LOG_VARTEXT_{START,END} to enclose text strings

Rename LOGQUOTE_{START,END} macros to more generic LOG_VARTEXT_{START,END}
in order to prepare for new encoding types that rely on specific treatment
for variable-length texts. No functional change should be expected.

14 months agoMINOR: log: explicitly handle %ts and %tsc as text strings
Aurelien DARRAGON [Tue, 23 Apr 2024 16:25:32 +0000 (18:25 +0200)] 
MINOR: log: explicitly handle %ts and %tsc as text strings

Build fixed-length strings for %ts and %tsc to be able to print them
using lf_rawtext_len(), this way it will be easier to encode them
when new encoding options will be added.

No functional change should be expected.

14 months agoMEDIUM: log: use lf_rawtext for lf_ip() and lf_port() hex strings
Aurelien DARRAGON [Wed, 3 Apr 2024 13:42:35 +0000 (15:42 +0200)] 
MEDIUM: log: use lf_rawtext for lf_ip() and lf_port() hex strings

Same as the previous commit, but for ip and port oriented values when
+X option is provided.

No functional change should be expected.

Because of this patch, we add a little overhead because we first generate
the text into a temporary variable and then use lf_rawtext() to print it.
Thus we have a double-copy, and this could have some performance
implications that were not yet evaluated. Due to the small number of bytes
that can end up being copied twice, we could be lucky and have no visible
performance impact, but if we happen to see a significant impact, it could
be useful to add a passthrough mechanism (to keep historical behavior)
when no encoding is involved.

14 months agoMEDIUM: log: write raw strings using lf_rawtext()
Aurelien DARRAGON [Wed, 27 Mar 2024 09:28:59 +0000 (10:28 +0100)] 
MEDIUM: log: write raw strings using lf_rawtext()

Make use of the previous commit to print strings that should not be
modified.

For instance, when +X option is provided, we have to print numerical
values in ASCII HEX form. For that, we used snprintf() to output the
result to the log output buffer directly, but now we build the string in
a temporary buffer of fixed-size and then print it using lf_rawtext()
which will take care of encoding options.

Because of this patch, we add a little overhead because we first generate
the text into a temporary variable and then use lf_rawtext() to print it.
Thus we have a double-copy, and this could have some performance
implications that were not yet evaluated. Due to the small number of bytes
that can end up being copied twice, we could be lucky and have no visible
performance impact, but if we happen to see a significant impact, it could
be useful to add a passthrough mechanism (to keep historical behavior)
when no encoding is involved.

14 months agoMEDIUM: log: pass date strings to lf_rawtext()
Aurelien DARRAGON [Wed, 3 Apr 2024 09:08:15 +0000 (11:08 +0200)] 
MEDIUM: log: pass date strings to lf_rawtext()

Don't directly call functions that take date as argument and output the
string representation to the log output buffer under sess_build_logline(),
and instead build the strings in temporary buffers of fixed size
(hopefully such functions, such as date2str_log() and gmt2str_log()
procuce strings of known size), and then print the result using
lf_rawtext() helper function. This way, we will be able to encode them
automatically as regular string/text when new encoding methods are added.

Because of this patch, we add a little overhead because we first generate
the text into a temporary variable and then use lf_rawtext() to print it.
Thus we have a double-copy, and this could have some performance
implications that were not yet evaluated. Due to the small number of bytes
that can end up being copied twice (< 30), we could be lucky and have no
visible performance impact, but if we happen to see a significant impact,
it could be useful to add a passthrough mechanism (to keep historical
behavior) when no encoding is involved.

14 months agoMINOR: log: add lf_rawtext{_len}() functions
Aurelien DARRAGON [Wed, 10 Apr 2024 10:07:26 +0000 (12:07 +0200)] 
MINOR: log: add lf_rawtext{_len}() functions

similar to lf_text_{len}, except that quoting and mandatory options are
ignored. Use this to print the input string without any modification (
except for encoding logic).

14 months agoMINOR: log: add lf_int() wrapper to print integers
Aurelien DARRAGON [Wed, 27 Mar 2024 09:17:11 +0000 (10:17 +0100)] 
MINOR: log: add lf_int() wrapper to print integers

Wrap ltoa(), lltoa(), ultoa() and utoa_pad() functions that are used by
sess_build_logline() to print numerical values by implementing a dedicated
helper named lf_int() that takes <dft_hld> as argument to know how to
write the integer by default (when no encoding is specified).

LF_INT_UTOA_PAD_4 is used to emulate utoa_pad(x, 4) since it's found only
once under sess_build_logline(), thus there is no need to pass an extra
parameter to lf_int() function.

14 months agoMINOR: log: skip custom logformat_node name if empty
Aurelien DARRAGON [Thu, 25 Apr 2024 07:50:14 +0000 (09:50 +0200)] 
MINOR: log: skip custom logformat_node name if empty

Reminder:

Since 3.0-dev4, we can optionally give a name to logformat nodes:

  log-format "%(custom_name1)B %(custom_name2)[str(value)]"

But we may also optionally set the expected node type by appending
':type' after the name, type being either sint,str or bool, like this:

  log-format "%(string_as_int:sint)[str(14)]"

However, it is currently not possible to provide a type without providing
a name that is a least 1 char long. But it could be useful to provide a
type without setting a name, like this, for typecasting purposes only:

  log-format "%(:sint)[bool(true)]"

Thus in order to allow this usage, don't set node->name if node name is
not at least 1 character long. By doing so, node->name will remain NULL
and will not be considered, but the typecast setting will.

14 months agoCLEANUP: log: simplify complex values usages in sess_build_logline()
Aurelien DARRAGON [Tue, 26 Mar 2024 10:50:50 +0000 (11:50 +0100)] 
CLEANUP: log: simplify complex values usages in sess_build_logline()

make sess_build_logline() switch case more readable by performing some
simplifications: complex values are first extracted in a temporary
variable so that it's easier to refer to them and at a single place.

14 months agoMINOR: log: global lf_expr node options
Aurelien DARRAGON [Mon, 25 Mar 2024 16:08:17 +0000 (17:08 +0100)] 
MINOR: log: global lf_expr node options

Add options to lf_expr->nodes to store global options (those that are
common to all node) for easier access.

No functional change should be expected.

14 months agoMINOR: log: store lf_expr nodes inside substruct
Aurelien DARRAGON [Mon, 25 Mar 2024 10:29:58 +0000 (11:29 +0100)] 
MINOR: log: store lf_expr nodes inside substruct

Add another struct level inside lf_expr struct to allow new information
to be stored alongside lf_expr nodes.

14 months agoCLEANUP: log: remove unused checks for encode_{chunk,string}
Aurelien DARRAGON [Tue, 9 Apr 2024 15:54:41 +0000 (17:54 +0200)] 
CLEANUP: log: remove unused checks for encode_{chunk,string}

Thanks to 8226e92eb ("BUG/MINOR: tools/log: invalid
encode_{chunk,string} usage"), we only need to check for NULL return
value from encode_{chunk,string}() and escape_string() to know if the
call failed.

14 months agoBUG/MINOR: mworker: reintroduce way to disable seamless reload with -x /dev/null
William Lallemand [Fri, 26 Apr 2024 13:08:31 +0000 (15:08 +0200)] 
BUG/MINOR: mworker: reintroduce way to disable seamless reload with -x /dev/null

Since the introduction of the automatic seamless reload using the
internal socketpair, there is no way of disabling the seamless reload.

Previously we just needed to remove -x from the startup command line,
and remove any "expose-fd" keyword on stats socket lines.

This was introduced in 2be557f7c ("MEDIUM: mworker: seamless reload use
the internal sockpairs").

The patch copy /dev/null again and pass it to the next exec so we never
try to get socket from the -x.

Must be backported as far as 2.6.

14 months agoMEDIUM: stats: define stats-file keyword
Amaury Denoyelle [Wed, 24 Apr 2024 09:10:07 +0000 (11:10 +0200)] 
MEDIUM: stats: define stats-file keyword

This commit is the final to implement preloading of haproxy internal
counters via stats-file parsing.

Define a global keyword "stats-file". It allows to specify the path to
the stats-file which will be parsed on process startup.

14 months agoMINOR: stats: parse values from stats-file
Amaury Denoyelle [Wed, 24 Apr 2024 09:15:18 +0000 (11:15 +0200)] 
MINOR: stats: parse values from stats-file

This patch implement parsing of counter values line from stats-file. It
reuses domain context previously set by the last header line. Each
value is separated by ',' character, relative to the list of column
names describe by the header line.

This is implemented via static function parse_stat_line(). It first
extract a GUID and retrieve the object instance. Then each numerical
value is parsed and object counters updated. For the moment, only U64
counters metrics is supported. parse_stat_line() is called on each line
until a new header line is found.

14 months agoMINOR: stats: parse header lines from stats-file
Amaury Denoyelle [Wed, 24 Apr 2024 09:14:48 +0000 (11:14 +0200)] 
MINOR: stats: parse header lines from stats-file

This patch implements parsing of headers line from stats-file.

A header line is defined as starting with '#' character. It is directly
followed by a domain name. For the moment, either 'fe' or 'be' is
allowed. The following lines will contain counters values relatives to
the domain context until the next header line.

This is implemented via static function parse_header_line(). It first
sets the domain context used during apply_stats_file(). A stats column
array is generated to contains the order on which column are stored.
This will be reused to parse following lines values.

If an invalid line is found and no header was parsed, considered the
stats-file as ill formatted and stop parsing. This allows to immediately
interrupt parsing if a garbage file was used without emitting a ton of
warnings to the user.

14 months agoMINOR: stats: apply stats-file on process startup
Amaury Denoyelle [Wed, 24 Apr 2024 09:09:06 +0000 (11:09 +0200)] 
MINOR: stats: apply stats-file on process startup

This commit is the first one of a serie to implement preloading of
haproxy counters via stats-file parsing.

This patch defines a basic apply_stats_file() function. It implements
reading line by line of a stats-file without any parsing for the moment.
It is called automatically on process startup via init().

14 months agoMINOR: guid: define guid_is_valid_fmt()
Amaury Denoyelle [Thu, 11 Apr 2024 09:10:13 +0000 (11:10 +0200)] 
MINOR: guid: define guid_is_valid_fmt()

Extract GUID format validation in a dedicated function named
guid_is_valid_fmt(). For the moment, it is only used on guid_insert().

This will be reused when parsing stats-file, to ensure GUID has a valid
format before tree lookup.

14 months agoMINOR: ist: define iststrip() new function
Amaury Denoyelle [Fri, 26 Apr 2024 08:16:25 +0000 (10:16 +0200)] 
MINOR: ist: define iststrip() new function

Implement iststrip(). This function removes any trailing newline
sequence if present from an ist.

14 months agoMEDIUM: stats: implement dump stats-file CLI
Amaury Denoyelle [Thu, 28 Mar 2024 13:53:52 +0000 (14:53 +0100)] 
MEDIUM: stats: implement dump stats-file CLI

Define a new CLI command "dump stats-file" with its handler
cli_parse_dump_stat_file(). It will loop twice on proxies_list to dump
first frontend and then backend side. It reuses the common function
stats_dump_stat_to_buffer(), using STAT_F_BOUND to restrict on the
correct side.

A new module stats-file.c is added to regroup function specifics to
stats-file. It defines two main functions :
* stats_dump_file_header() to generate the list of column list prefixed
  by the line context, either "#fe" or "#be"
* stats_dump_fields_file() to generate each stat lines. Object without
  GUID are skipped. Each stat entry is separated by a comma.

For the moment, stats-file does not support statistics modules. As such,
stats_dump_*_line() functions are updated to prevent looping over stats
module on stats-file output.

14 months agoMINOR: stats: define stats-file output format support
Amaury Denoyelle [Tue, 16 Apr 2024 16:17:48 +0000 (18:17 +0200)] 
MINOR: stats: define stats-file output format support

Prepare stats function to handle a new format labelled "stats-file". Its
purpose is to generate a statistics dump with a format closed from the
CSV output. Such output will be then used to preload haproxy internal
counters on process startup.

stats-file output differs from a standard CSV on several points. First,
only an excerpt of all statistics is outputted. All values that does not
make sense to preload are excluded. For the moment, stats-file only list
stats fully defined via "struct stat_col" method. Contrary to a CSV, sll
columns of a stats-file will be filled. As such, empty field value is
used to mark stats which should not be outputted.

Some adaptation specifics to stats-file are necessary into
me_generate_field(). First, stats-file will output separatedly values
from frontend and backend sides with their own respective set of
columns. As such, an empty field value is returned if stat is not
defined for either frontend/listener, or backend/server when outputting
the other side. Also, as stats-file does not support empty column,
stcol_hide() is not used for it.

A minor adjustement was necessary for stats_fill_fe_line() to pass
context flags. This is necessary to detect stat output format. All other
listener/server/backend corresponding functions already have it.

14 months agoMEDIUM: stats: convert counters to new column definition
Amaury Denoyelle [Wed, 3 Apr 2024 15:20:50 +0000 (17:20 +0200)] 
MEDIUM: stats: convert counters to new column definition

Convert most of proxy counters statistics to new "struct stat_col"
definition. Remove their corresponding switch..case entries in
stats_fill_*_line() functions. Their value are automatically calculate
via me_generate_field() invocation.

Along with this, also complete stcol_hide() when some stats should be
hidden.

Only a few counters where not converted. This is because they rely on
values stored outside of fe/be_counters structure, which
me_generate_field() cannot use for now.

14 months agoMINOR: stats: hide some columns in output
Amaury Denoyelle [Wed, 17 Apr 2024 09:12:27 +0000 (11:12 +0200)] 
MINOR: stats: hide some columns in output

Metric style stats can be automatically calculate since the introduction
of metric_generate() when using "struct stat_col" as input. This would
allow to centralize statistics generation. However, some stats are not
outputted under specific condition. For example, health check failures
on a server are only reported if checks are active.

To support this, define a new function metric_hide(). It is called by
metric_generate(). If true, it will skip metric calcuation and return an
empty field value instead. This allows to define "stat_col" metrics and
calculate them with metric_generate() but hiding them under certain
circumstances.

14 months agoMINOR: stats: implement automatic metric generation from stat_col
Amaury Denoyelle [Thu, 11 Apr 2024 11:56:19 +0000 (13:56 +0200)] 
MINOR: stats: implement automatic metric generation from stat_col

This commit is a direct follow-up of the previous one which define a new
type "struct stat_col" to fully define a statistic entry.

Define a new function metric_generate(). For metrics statistics, it is
able to automatically calculate a stat value field for "offsets" from
"struct stat_col". Use it in stats_fill_*_stats() functions. Maintain a
fallback to previously used switch-case for old-style statistics.

This commit does not introduce functional change as currently no
statistic is defined as "struct stat_col". This will be the subject of a
future commit.

14 months agoMINOR: stats: introduce a more expressive stat definition method
Amaury Denoyelle [Thu, 28 Mar 2024 13:53:39 +0000 (14:53 +0100)] 
MINOR: stats: introduce a more expressive stat definition method

Previously, statistics were simply defined as a list of name_desc, as
for example "stat_cols_px" for proxy stats. No notion of type was fixed
for each stat definition. This correspondance was done individually
inside stats_fill_*_line() functions. This renders the process to
define new statistics tedious.

Implement a more expressive stat definition method via a new API. A new
type "struct stat_col" for stat column to replace name_desc usage is
defined. It contains a field to store the stat nature and format. A
<cap> field is also defined to be able to define a proxy stat only for
certain type of objects.

This new type is also further extended to include counter offsets. This
allows to define a method to automatically generate a stat value field
from a "struct stat_col". This will be the subject of a future commit.

New type "struct stat_col" is fully compatible full name_desc. This
allows to gradually convert stats definition. The focus will be first
for proxies counters to implement statistics preservation on reload.

14 months agoMINOR: stats: update ambiguous "metrics" naming to "stat_cols"
Amaury Denoyelle [Tue, 23 Apr 2024 09:06:00 +0000 (11:06 +0200)] 
MINOR: stats: update ambiguous "metrics" naming to "stat_cols"

The name "metrics" was chosen to represent the various list of haproxy
exposed statistics. However, it is deemed as ambiguous as some stats are
indeed metric in the true sense, but some are not, as highlighted by
various "enum field_origin" values.

Replace it by the new name "stat_cols" for statistic columns. Along with
the already existing notion of stat lines it should better reflect its
purpose.

14 months agoBUG/MINOR: peers: Don't wait for a remote resync if there no remote peer
Christopher Faulet [Thu, 25 Apr 2024 19:47:01 +0000 (21:47 +0200)] 
BUG/MINOR: peers: Don't wait for a remote resync if there no remote peer

When a resync is needed, a local resync is first tried and if it does not
work, a remote resync is tried. It happens when the worker is started for
instance. There is a timeout to wait for the local resync, except for the
first start. And if the local resync fails or times out, the same timeout
is applied to the remote resync. This one is always applied, even if there
is no remote peer.

On the other hand, on reload, if the old worker has never performed its
resync, it does not try to resync the new worker. And here there is an
issue. On the first reload, when there is no remote peer, we must wait for
the resync timeout expiration to have a chance to resync the new worker. If
the reload happens too early, there is no resync at all. Concretly, after a
fresh start, if a reload happens in the first 5 seconds, there is no resync
with the new worker. The issue only concerns the first reload and affects
the second worker.

To fix the issue, we must only skip the remote resync if there is no remote
peer. This way, on a fresh start, the worker is immediately considered as
resync. The local reynsc is skipped because it is the first worker and the
remote resync is skipped because there is no remote peer.

This patch must be backported to all stable versions.

14 months agoREORG: peers: Rename all occurrences to 'ps' variable
Christopher Faulet [Thu, 25 Apr 2024 08:57:44 +0000 (10:57 +0200)] 
REORG: peers: Rename all occurrences to 'ps' variable

In loops on the peer list in the code, the 'ps' variable was used as a
shortcut for the peer session. However, if mays be confusing with the peers
section too. So, all occurrences to 'ps' variable were renamed to 'peer'.

14 months agoBUG/MEDIUM: peers: Use atomic operations on peers flags when necessary
Christopher Faulet [Thu, 25 Apr 2024 08:51:18 +0000 (10:51 +0200)] 
BUG/MEDIUM: peers: Use atomic operations on peers flags when necessary

Peers flags are mainly used from the sync task. At least, it is only updated
by the sync task. However, there is one place where a peer may read these
flags, when the message marking the end of a synchro is sent.

So to be sure the value retrieved at this place is consistent, we must use
an atomic operation to read it. And of course, from the sync task, atomic
operations must be used to update peers flags. However, from the sync task,
there is no reason to use atomic operations to read flags because they
cannot be update from somewhere eles.

14 months agoMINOR: peers: Use a static variable to wait a resync on reload
Christopher Faulet [Thu, 25 Apr 2024 08:29:32 +0000 (10:29 +0200)] 
MINOR: peers: Use a static variable to wait a resync on reload

When a process is reloaded, the old process must performed a synchronisation
with the new process. To do so, the sync task notify the local peer to
proceed and waits. Internally, the sync task used PEERS_F_DONOTSTOP flag to
know it should wait. However, this flag was only set/unset in a single
function. There is no real reason to set a flag to do so. A static variable
set to 1 when the resync starts and to 0 when it is finished is enough.

14 months agoMINOR: peers: Add comment on processing functions of the sync task
Christopher Faulet [Thu, 25 Apr 2024 07:49:00 +0000 (09:49 +0200)] 
MINOR: peers: Add comment on processing functions of the sync task

Just add a comment on __process_running_peer_sync() and
__process_stopping_peer_sync() functions.

14 months agoDEV: flags/peers: Decode PEER and PEERS flags
Christopher Faulet [Thu, 25 Apr 2024 07:43:16 +0000 (09:43 +0200)] 
DEV: flags/peers: Decode PEER and PEERS flags

Decode peer and peers flags via peer_show_flags() and peers_show_flags()
functions.

14 months agoREORG: peers: Move peer and peers flags in the corresponding header file
Christopher Faulet [Thu, 25 Apr 2024 07:42:05 +0000 (09:42 +0200)] 
REORG: peers: Move peer and peers flags in the corresponding header file

PEER_F_* and PEERS_F_ * flags were moved to <peer-t.h> header file. It is
mandatory to decode them from "flags" dev tool.

14 months agoMINOR: peers: Reorder and rename PEERS flags
Christopher Faulet [Thu, 25 Apr 2024 07:17:38 +0000 (09:17 +0200)] 
MINOR: peers: Reorder and rename PEERS flags

Peers flags were renamed and reordered, mainly to move flags used for
debugging purpose at the end.

PEERS_F_RESYNC_LOCAL and PEERS_F_RESYNC_REMOTE were also renamed to
PEERS_F_RESYNC_LOCAL_FINISHED and PEERS_F_RESYNC_REMOTE_FINISHED to be clear
on the fact the operation is finished when the flag is set.

14 months agoMINOR: peers: Reorder and slightly rename PEER flags
Christopher Faulet [Thu, 25 Apr 2024 06:43:21 +0000 (08:43 +0200)] 
MINOR: peers: Reorder and slightly rename PEER flags

There are too many holes in peer flags. So let's reorder them. In addition,
PEER_F_RESYNC_REQUESTED flag was renamed to PEER_F_DBG_RESYNC_REQUESTED to
clearly state it is a flag set for debugging purpose.

Finally, PEER_TEACH_RESET was replaced by PEER_TEACH_FLAGS and the bitwise
complement operator is now used on lines updating the peer flags. It is a
far more common way to do (in HAProxy code at least) and less surprising.

14 months agoMINOR: peers: Rename PEERS_F_TEACH_COMPLETE to PEERS_F_LOCAL_TEACH_COMPLETE
Christopher Faulet [Thu, 25 Apr 2024 06:27:20 +0000 (08:27 +0200)] 
MINOR: peers: Rename PEERS_F_TEACH_COMPLETE to PEERS_F_LOCAL_TEACH_COMPLETE

PEERS_F_TEACH_COMPLETE flag is only used for the old local peer to let the
sync task know it can stop waiting during a soft-stop. So it is less
confusing to rename this flag to clearly state it concerns local peer only.

14 months agoMINOR: peers: Start learning for local peer before receiving messages
Christopher Faulet [Wed, 24 Apr 2024 18:55:23 +0000 (20:55 +0200)] 
MINOR: peers: Start learning for local peer before receiving messages

A local peer assigned for leaning can immediately start to learn, without
sending any request. So we can do that first, before receiving
messages. This way, only PEER_LR_ST_PROCESSING state is evaluating when
received messages are processed.

In addition, when the resync request is sent, we are sure it is for a remote
peer.

14 months agoMEDIUM: peers: Use true states for the learn state of a peer
Christopher Faulet [Wed, 24 Apr 2024 18:46:55 +0000 (20:46 +0200)] 
MEDIUM: peers: Use true states for the learn state of a peer

Some flags were used to define the learn state of a peer. It was a bit
confusing, especially because the learn state of a peer is manipulated from
the peer applet but also from the sync task. It is harder to understand the
transitions if it is based on flags than if it is based a dedicated state
based on an enum. It is the purpose of this patch.

Now, we can define the following rules regarding this learn state:

  * A peer is assigned to learn by the sync task
  * The learn state is then changed by the peer itself to notify the
    learning is in progress and when it is finished.
  * Finally, when the peer finished to learn, the sync task must acknowledge
    it by unassigning the peer.

14 months agoMEDIUM: peers: Use true states for the peer applets as seen from outside
Christopher Faulet [Wed, 24 Apr 2024 15:57:29 +0000 (17:57 +0200)] 
MEDIUM: peers: Use true states for the peer applets as seen from outside

This patch is a cleanup of the recent change about the relation between a
peer and the applet used to deal with I/O. Three flags was introduced to
reflect the peer applet state as seen from outside (from the sync task in
fact). Using flags instead of true states was in fact a bad idea. This work
but it is confusing. Especially because it was mixed with LEARN and TEACH
peer flags.

So, now, to make it clearer, we are now using a dedicated state for this
purpose. From the outside, the peer may be in one of the following state
with respects of its applet:

 * the peer has no applet, it is stopped (PEER_APP_ST_STOPPED).

 * the peer applet was created with a validated connection from the protocol
   perspective. But the sync task must synchronized it with the peers
   section. It is in starting state (PEER_APP_ST_STARTING).

 * The starting starting was acknowledged by the sync task, the peer applet
   can start to process messages. It is in running state
   (PEER_APP_ST_RUNNING).

 * The last peer applet was released and the associated connection
   closed. But the sync task must synchronized it with the peers section. It
   is in stopping state (PEER_APP_ST_STOPPING).

Functionnaly speaking, there is no true change here. But it should be easier
to understand now.

In addition to these changes, __process_peer_state() function was renamed
sync_peer_app_state().

14 months agoMEDIUM: peers: Simplify the peer flags dealing with the connection state
Christopher Faulet [Wed, 24 Apr 2024 13:42:55 +0000 (15:42 +0200)] 
MEDIUM: peers: Simplify the peer flags dealing with the connection state

Recently, some peer flags were added to deal with the connection state
(PEER_F_ST_*). 3 states were added:

  * RELEASED: Set when we forced to shutdown the peer session and no new
    session was created yet.

  * CONNECTED: Set when the peer has established connection and validated it
    from the peer protocol point of view

  * ACCEPTED: Set when the peer has accepted a connection and validated it
    from the peer protocol point of view

However, management of these pseudo states is a bit confusing. And it
appears there is no reason to have 2 flags to express there is a validated
peer session. CONNECTED state was used for a peer session on the frontend
side while ACCEPTED state was used for a peer session on the backend side.

So, there is now only one "connected" state and we test if the applet was
created on the frontend or the backend side to decide what to do, in
addition to the fact the peer is local or remote.

It is a transitionnal patch. True states will be created to deal with all
this stuff and corresponding flags will be removed.

This patch depends on the commit "MINOR: applet: Add a function to know the
sidde where an applet was created".

14 months agoMINOR: applet: Add a function to know the side where an applet was created
Christopher Faulet [Wed, 24 Apr 2024 12:36:17 +0000 (14:36 +0200)] 
MINOR: applet: Add a function to know the side where an applet was created

appctx_is_back() function may be used to know if an applet was create on
frontend side or on backend side. It may be handy for some applets that may
exist on both sides, like peer applets.

14 months agoMINOR: peers: Remove unused PEERS_F_RESYNC_PROCESS flag
Christopher Faulet [Wed, 24 Apr 2024 09:42:16 +0000 (11:42 +0200)] 
MINOR: peers: Remove unused PEERS_F_RESYNC_PROCESS flag

This flag is now set or unset but never tested. So we can safely remove it.

14 months agoBUG/MEDIUM: peers: Wait for sync task ack when a resynchro is finished
Christopher Faulet [Wed, 24 Apr 2024 08:53:46 +0000 (10:53 +0200)] 
BUG/MEDIUM: peers: Wait for sync task ack when a resynchro is finished

When a learning process is finished, partially or not, the event must be
processed by the sync task. It is important for the peer applet to wait in
this case, especially if the same peer is teaching to another peer, to be
sure to send the right resync finished message (full or partial).

Thanks to the previous patch, we can set PEER_F_WAIT_SYNCTASK_ACK flag on
the peer when a PEER_MSG_CTRL_RESYNCPARTIAL or PEER_MSG_CTRL_RESYNCFINISHED
message is received to be sure to stop the processing. Of course, we must
also take care to wake the peer up after having acknowledged the learn
status from the sync task.

This patch depends on the commit "BUG/MEDIUM: peers: Wait for sync task ack
when a resynchro is finished". Both must be backported if commit 9425aeaffb
("BUG/MAJOR: peers: Update peers section state from a thread-safe manner")
is backported.

14 months agoMINOR: peers: Use a peer flag to block the applet waiting ack of the sync task
Christopher Faulet [Wed, 24 Apr 2024 08:41:07 +0000 (10:41 +0200)] 
MINOR: peers: Use a peer flag to block the applet waiting ack of the sync task

Since recent fixes on peers, some changes on a peer must be acknowledged
by the sync task before letting the peer applet processing messages.
Blocking conditions was based on a combination of flags. It was
errorprone. So, this patch introduces PEER_F_WAIT_SYNCTASK_ACK peer flag for
this purpose. This flag is set by the peer when it must wait for an ack from
the sync task. This sync task, on its side, must remove it and wake the peer
up.

14 months agoMINOR: peers: Don't set TEACH flags on a peer from the sync task
Christopher Faulet [Wed, 24 Apr 2024 07:32:55 +0000 (09:32 +0200)] 
MINOR: peers: Don't set TEACH flags on a peer from the sync task

The TEACH flags only concerns the peer applet. There is no reason to set it
from the sync task. It is confusing. And at the end, after some
refactoring/fixes, setting these flags directly from the peer applet will
allow us to immediatly performing the corresponding teach processing, while
for now we must wait the sync task acknowledges the changes.

14 months agoMINOR: peers: Remove unused PEERS_F_RESYNC_REQUESTED flag
Christopher Faulet [Tue, 23 Apr 2024 16:58:14 +0000 (18:58 +0200)] 
MINOR: peers: Remove unused PEERS_F_RESYNC_REQUESTED flag

This flag was used for debugging purpose to know a resync was requested at
least once in the process life. Since the last bunch of fixes about the
peers locking mechanism, this info is now set per-peer. There is no reason
to still have it on peers too. So, just remove it.

14 months agoBUG/MEDIUM: peers: Reprocess peer state after all session shutdowns
Christopher Faulet [Wed, 24 Apr 2024 14:38:13 +0000 (16:38 +0200)] 
BUG/MEDIUM: peers: Reprocess peer state after all session shutdowns

When a session is shut down, the peer is switched in released state
(PEER_F_ST_RELEASED) and the sync task must process it to eventually
perform some clean up, in case the peer was assigned to learn.

However, this was only true when the session was shut down from the peer
applet itself. This was not performed when it was shut down from the sync
task. It is now fixed.

14 months agoBUG/MEDIUM: peers: Automatically start to learn on local peer
Christopher Faulet [Wed, 24 Apr 2024 08:18:07 +0000 (10:18 +0200)] 
BUG/MEDIUM: peers: Automatically start to learn on local peer

The previous fix (c0b2015aae "BUG/MEDIUM: peers: Don't set
PEERS_F_RESYNC_PROCESS flag on a peer") was made due to lack of knowledge on
the peers. A local peer, when assigned to learn, must start to learn
immediately without sending any request. This happens on reload.

Thus, in this case, the PEER_F_LEARN_PROCESS flag must be set with
PEER_F_LEARN_ASSIGN flag from the sync task.

This patch must only be backported if the above commit is backported.

14 months agoREGTESTS: ssl: Remove "sleep" calls from ocsp auto update test
Remi Tricot-Le Breton [Mon, 22 Apr 2024 15:09:13 +0000 (17:09 +0200)] 
REGTESTS: ssl: Remove "sleep" calls from ocsp auto update test

Instead of relying on the http client logs for synchronization, use the
specific OCSP logs that are emitted after the newly updated response is
inserted in the tree. This removes the need to wait between the syslog
reception and the insertion that was managed thanks to "sleep" calls.
This regtest can now be switched back to "devel" type instead of "slow".

14 months agoCLEANUP: h1: make use of the multi-byte matching functions
Willy Tarreau [Wed, 24 Apr 2024 13:57:15 +0000 (15:57 +0200)] 
CLEANUP: h1: make use of the multi-byte matching functions

Instead of leaving the hard-coded non-trivial operations in the H1
parsing code, let's just rely on the new intops functions that do the
same and that are less prone to being accidentally touched. It was
verified that the resulting code is exactly the same.

14 months agoTESTS: add a unit test for the multi-byte range checks
Willy Tarreau [Wed, 24 Apr 2024 14:02:46 +0000 (16:02 +0200)] 
TESTS: add a unit test for the multi-byte range checks

The test scans the whole number space in 32 bits and compares the different
functions with the reference that does one byte at a time. In 64-bit mode,
it picks 2^32 64-bit random numbers and tests that they the 64-bit functions
all produce the expected results when submitted such numbers.

It optionally takes an initial offset and step so that it can run on
multiple cores (or even machines), though the test is reasonably fast
on modern machines, around 10s per core.

14 months agoMINOR: intops: add a pair of functions to check multi-byte ranges
Willy Tarreau [Wed, 24 Apr 2024 13:23:28 +0000 (15:23 +0200)] 
MINOR: intops: add a pair of functions to check multi-byte ranges

These new functions is_char4_outside() and is_char8_outside() are meant
to be used to verify if any of the 4 or 8 chars represented respectively
by a uint32_t or a uint64_t is outside of the min,max byte range passed
in argument. This is the simplified, fast version of the function so it
is restricted to less than 0x80 distance between min and max (sufficient
to validate chars). Extra functions are also provided to check for min
or max alone as well, with the same restriction.

The use case typically is to check that the output of read_u32() or
read_u64() contains exclusively certain bytes.

14 months agoBUG/MINOR: h1: fix detection of upper bytes in the URI
Willy Tarreau [Wed, 24 Apr 2024 09:37:06 +0000 (11:37 +0200)] 
BUG/MINOR: h1: fix detection of upper bytes in the URI

In 1.7 with commit 5f10ea30f4 ("OPTIM: http: improve parsing performance
of long URIs") we improved the URI parser's performance on platforms
supporting unaligned accesses by reading 4 chars at a time in a 32-bit
word. However, as reported in GH issue #2545, there's a bug in the way
the top bytes are checked, as the parser will stop when all 4 of them
are above 7e instead of when one of them is, so certain patterns can be
accepted through if the last ones are all valid. The fix requires to
negate the value but on the other hand it allows to parallelize some of
the tests and fuse the masks, which could even end up slightly faster.

This needs to be backported to all stable versions, but be careful, this
code moved a lot over time, from proto_http.c to h1.c, to http_msg.c, to
h1.c again. Better just grep for "24242424" or "21212121" in each version
to find it.

Big kudos to Martijn van Oosterhout (@kleptog) for spotting this problem
while analyzing that piece of code, and reporting it.

14 months agoMEDIUM: shctx: Naming shared memory context
David Carlier [Sat, 20 Apr 2024 06:18:48 +0000 (07:18 +0100)] 
MEDIUM: shctx: Naming shared memory context

From Linux 5.17, anonymous regions can be name via prctl/PR_SET_VMA
so caches can be identified when looking at HAProxy process memory
mapping.
The most possible error is lack of kernel support, as a result
we ignore it, if the naming fails the mapping of memory context
ought to still occur.

14 months agoMINOR: Add support for UUIDv7 to the `uuid` sample fetch
Tim Duesterhus [Fri, 19 Apr 2024 19:01:27 +0000 (21:01 +0200)] 
MINOR: Add support for UUIDv7 to the `uuid` sample fetch

This adds support for UUIDv7 to the existing `uuid` sample fetch that was added
in 8a694b859cf98f8b0855b4aa5a50ebf64b501215.

14 months agoMINOR: Add `ha_generate_uuid_v7`
Tim Duesterhus [Fri, 19 Apr 2024 19:01:26 +0000 (21:01 +0200)] 
MINOR: Add `ha_generate_uuid_v7`

This function generates a version 7 UUID as per
draft-ietf-uuidrev-rfc4122bis-14.

14 months agoMINOR: tools: Rename `ha_generate_uuid` to `ha_generate_uuid_v4`
Tim Duesterhus [Fri, 19 Apr 2024 19:01:25 +0000 (21:01 +0200)] 
MINOR: tools: Rename `ha_generate_uuid` to `ha_generate_uuid_v4`

This is in preparation of adding support for other UUID versions.

14 months agoBUILD: stick-tables: silence build warnings when threads are disabled
Willy Tarreau [Wed, 24 Apr 2024 06:19:20 +0000 (08:19 +0200)] 
BUILD: stick-tables: silence build warnings when threads are disabled

Since 3.0-dev7 with commit 1a088da7c2 ("MAJOR: stktable: split the keys
across multiple shards to reduce contention"), building without threads
yields a warning about the shard not being used. This is because the
locks API does nothing of its arguments, which is the only place where
the shard is being used. We cannot modify the lock API to pretend to
consume its argument because quite often it's not even instantiated.
Let's just pretend we consume shard using an explict ALREADY_CHECKED()
statement instead. While we're at it, let's make sure that XXH32() is
not called when there is a single bucket!

No backport is needed.

14 months agoBUG/MEDIUM: applet: Let's applets decide if they have more data to deliver
Christopher Faulet [Mon, 22 Apr 2024 16:49:55 +0000 (18:49 +0200)] 
BUG/MEDIUM: applet: Let's applets decide if they have more data to deliver

Unlike the muxes, the applets have the responsibility to notify the SC if
they have more data to deliver to the stream. The same is done to notify the
SC that applets must be woken up ASAP to continue some processing. When an
applet is woken up, we pretend it has no more data to deliver by setting
SE_FL_HAVE_NO_DATA flag. If the applet removes this flag, we must take care
to not set it again just after. Otherwise, the applet may remain blocked if
there is no other condition to wake it up.

It is an issue for the applets using their own buffers because
SE_FL_HAVE_NO_DATA is erroneously set in sc_applet_recv() function, after
the applet execution. For instance, it happens for the cli applet when a
huge map is cleared. No data are delivered to the stream but we pretend it
is the case to clear the map per batches.

This patch should fix the issue #2543. No Backported needed.

14 months agoMINOR: stats: use STAT_F_* prefix for flags
Amaury Denoyelle [Mon, 22 Apr 2024 12:42:09 +0000 (14:42 +0200)] 
MINOR: stats: use STAT_F_* prefix for flags

Some flags are defined during statistics generation and output. They use
the prefix STAT_* which is also used for other purposes. Rename them
with the new prefix STAT_F_* to differentiate them from the other
usages.

14 months agoMINOR: stats: use stricter naming stats/field/line
Amaury Denoyelle [Mon, 22 Apr 2024 08:26:23 +0000 (10:26 +0200)] 
MINOR: stats: use stricter naming stats/field/line

Several unique names were used for different purposes under statistics
implementation. This caused the code to be difficult to understand.

* stat/stats name is removed when a more specific name could be used
* restrict field usage to purely refer to <struct field> which
  represents a raw stat value.
* use "line" naming to represent an array of <struct field>

14 months agoMINOR: stats: rename info stats
Amaury Denoyelle [Mon, 22 Apr 2024 07:41:15 +0000 (09:41 +0200)] 
MINOR: stats: rename info stats

Info are used to expose haproxy global metrics. It is similar to proxy
statistics and any other module. As such, rename info indexes using
SI_I_INF_* prefix. Also info variable is renamed stat_line_info.

Thanks to this, naming is now consistent between info and other
statistics. It will help to integrate it as a "global" statistics
module.

14 months agoMINOR: stats: rename ambiguous stat_l and stat_count
Amaury Denoyelle [Mon, 22 Apr 2024 09:19:17 +0000 (11:19 +0200)] 
MINOR: stats: rename ambiguous stat_l and stat_count

Statistics were extended with the introduction of stats module. This
mechanism allows to expose various metrics for several haproxy
components. As a consequence of this, some static variables were
transformed to dynamic ones to be able to regroup all statistics
definition.

Rename these variables with more explicit naming :
* stat_lines can be used to generate one line of statistics for any
  module using struct field as value
* metrics and metrics_len are used to stored description of metrics
  indexed by module

Note that info is not integrated in the statistics module mechanism.
However, it could be done in the future to better reflect its purpose.

14 months agoMINOR: stats: rename proxy stats
Amaury Denoyelle [Fri, 19 Apr 2024 16:03:45 +0000 (18:03 +0200)] 
MINOR: stats: rename proxy stats

This commit is the first one of a serie which adjust naming convention
for stats module. The objective is to remove ambiguity and better
reflect how stats are implemented, especially since the introduction of
stats module.

This patch renames elements related to proxies statistics. One of the
main change is to rename ST_F_* statistics indexes prefix with the new
name ST_I_PX_*. This remove the reference to field which represents
another concept in the stats module. In the same vein, global
stat_fields variable is renamed metrics_px.

14 months agoREGTESTS: use -dI for insecure fork by default in the regtest scripts
William Lallemand [Mon, 22 Apr 2024 14:15:57 +0000 (16:15 +0200)] 
REGTESTS: use -dI for insecure fork by default in the regtest scripts

Let's remove the CI HAPROXY_ARGS setting and set -dI for anything run
with the run-regtests.sh.

14 months agoBUG/MINOR: stats: fix stot metric for listeners
Amaury Denoyelle [Thu, 4 Apr 2024 16:15:42 +0000 (18:15 +0200)] 
BUG/MINOR: stats: fix stot metric for listeners

This commit is part of a series to align counters usage between
frontends/listeners on one side and backends/servers on the other.

On frontend side, "stot" is the total count of sessions for both proxies
and listeners. For proxies, fe_counters <cum_sess> is correctely used.
The bug is on listeners where <cum_conn> value is returned, which
instead indicates a number of connection. This commit fixes this by
returning <cum_sess> counter value for "stot" metric.

Along this fixes, use the opportunity to report "conn_tot" for listeners
using <cum_conn> value, as for frontend proxies.

This commit fixes a bug but must not be backported as stats output is
changed.

14 months agoBUG/MINOR: backend: use cum_sess counters instead of cum_conn
Amaury Denoyelle [Thu, 4 Apr 2024 16:08:46 +0000 (18:08 +0200)] 
BUG/MINOR: backend: use cum_sess counters instead of cum_conn

This commit is part of a serie to align counters usage between
frontends/listeners on one side and backends/servers on the other.

"stot" metric refers to the total number of sessions. On backend side,
it is interpreted as a number of streams. Previously, this was accounted
using <cum_sess> be_counters field for servers, but <cum_conn> instead
for backend proxies.

Adjust this by using <cum_sess> for both proxies and servers. As such,
<cum_conn> field can be removed from be_counters.

Note that several diagnostic messages which reports total frontend and
backend connections were adjusted to use <cum_sess>. However, this is an
outdated and misleading information as it does reports streams count on
backend side. These messages should be fixed in a separate commit.

This should be backported to all stable releases.

14 months agoMINOR: backend: use be_counters for health down accounting
Amaury Denoyelle [Thu, 28 Mar 2024 16:37:07 +0000 (17:37 +0100)] 
MINOR: backend: use be_counters for health down accounting

This commit is the first one of a series which aims to align counters
usage between frontends/listeners on one side and backends/servers on
the other.

Remove <down_trans> field from proxy structure. Use instead the same
name field from be_counters structure, which is already used for
servers.

14 months agoBUILD: ssl: use %zd for sizeof() in ssl_ckch.c
William Lallemand [Sat, 20 Apr 2024 12:25:42 +0000 (14:25 +0200)] 
BUILD: ssl: use %zd for sizeof() in ssl_ckch.c

32bits build was broken because of wrong printf length modifier.

src/ssl_ckch.c:4144:66: error: format specifies type 'long' but the argument has type 'unsigned int' [-Werror,-Wformat]
 4143 |                                                 memprintf(err, "parsing [%s:%d] : cannot parse '%s' value '%s', too long, max len is %ld.\n",
      |                                                                                                                                      ~~~
      |                                                                                                                                      %u
 4144 |                                                           file, linenum, args[cur_arg], args[cur_arg + 1], sizeof(alias_name));
      |                                                                                                            ^~~~~~~~~~~~~~~~~~
src/ssl_ckch.c:4217:64: error: format specifies type 'long' but the argument has type 'unsigned int' [-Werror,-Wformat]
 4216 |                                 memprintf(err, "parsing [%s:%d] : cannot parse '%s' value '%s', too long, max len is %ld.\n",
      |                                                                                                                      ~~~
      |                                                                                                                      %u
 4217 |                                           file, linenum, args[cur_arg], args[cur_arg + 1], sizeof(alias_name));
      |                                                                                            ^~~~~~~~~~~~~~~~~~
2 errors generated.
make: *** [Makefile:1034: src/ssl_ckch.o] Error 1
make: *** Waiting for unfinished jobs....

Replace %ld by %zd.

Should fix issue #2542.

14 months ago[RELEASE] Released version 3.0-dev8 v3.0-dev8
Willy Tarreau [Fri, 19 Apr 2024 16:02:28 +0000 (18:02 +0200)] 
[RELEASE] Released version 3.0-dev8

Released version 3.0-dev8 with the following main changes :
    - BUG/MINOR: cli: Don't warn about a too big command for incomplete commands
    - BUG/MINOR: listener: always assign distinct IDs to shards
    - BUG/MINOR: log: fix lf_text_len() truncate inconsistency
    - BUG/MINOR: tools/log: invalid encode_{chunk,string} usage
    - BUG/MINOR: log: invalid snprintf() usage in sess_build_logline()
    - CLEANUP: log: lf_text_len() returns a pointer not an integer
    - MINOR: quic: simplify qc_send_hdshk_pkts() return
    - MINOR: quic: uniformize sending methods for handshake
    - MINOR: quic: improve sending API on retransmit
    - MINOR: quic: use qc_send_hdshk_pkts() in handshake IO cb
    - MEDIUM: quic: remove duplicate hdshk/app send functions
    - OPTIM: quic: do not call qc_send() if nothing to emit
    - OPTIM: quic: do not call qc_prep_pkts() if everything sent
    - BUG/MEDIUM: http-ana: Deliver 502 on keep-alive for fressh server connection
    - BUG/MINOR: http-ana: Fix TX_L7_RETRY and TX_D_L7_RETRY values
    - BUILD: makefile: warn about unknown USE_* variables
    - BUILD: makefile: support USE_xxx=0 as well
    - BUG/MINOR: guid: fix crash on invalid guid name
    - BUILD: atomic: fix peers build regression on gcc < 4.7 after recent changes
    - BUG/MINOR: debug: make sure DEBUG_STRICT=0 does work as documented
    - BUILD: cache: fix non-inline vs inline declaration mismatch to silence a warning
    - BUILD: debug: make DEBUG_STRICT=1 the default
    - BUILD: pools: make DEBUG_MEMORY_POOLS=1 the default option
    - CI: update the build options to get rid of unneeded DEBUG options
    - BUILD: makefile: get rid of the config CFLAGS variable
    - BUILD: makefile: allow to use CFLAGS to append build options
    - BUILD: makefile: drop the SMALL_OPTS settings
    - BUILD: makefile: move -O2 from CPU_CFLAGS to OPT_CFLAGS
    - BUILD: makefile: get rid of the CPU variable
    - BUILD: makefile: drop the ARCH variable and better document ARCH_FLAGS
    - BUILD: makefile: extract ARCH_FLAGS out of LDFLAGS
    - BUILD: makefile: move the fwrapv option to STD_CFLAGS
    - BUILD: makefile: make the ERR variable also support 0
    - BUILD: makefile: add FAILFAST to select the -Wfatal-errors behavior
    - BUILD: makefile: extract -Werror/-Wfatal-errors from automatic CFLAGS
    - BUILD: makefile: split WARN_CFLAGS from SPEC_CFLAGS
    - BUILD: makefile: rename SPEC_CFLAGS to NOWARN_CFLAGS
    - BUILD: makefile: do not pass warnings to VERBOSE_CFLAGS
    - BUILD: makefile: also drop DEBUG_CFLAGS
    - CLEANUP: makefile: make the output of the "opts" target more readable
    - DOC: install: clarify the build process by splitting it into subsections
    - BUG/MINOR: server: fix slowstart behavior
    - BUG/MEDIUM: cache/stats: Handle inbuf allocation failure in the I/O handler
    - MINOR: ssl: add the section parser for 'crt-store'
    - DOC: configuration: Add 3.12 Certificate Storage
    - REGTESTS: ssl: test simple case of crt-store
    - MINOR: ssl: rename ckchs_load_cert_file to new_ckch_store_load_files_path
    - MINOR: ssl/crtlist: alloc ssl_conf only when a valid keyword is found
    - BUG/MEDIUM: stick-tables: fix the task's next expiration date
    - CLEANUP: stick-tables: always respect the to_batch limit when trashing
    - BUG/MEDIUM: peers/trace: fix crash when listing event types
    - BUG/MAJOR: stick-tables: fix race with peers in entry expiration
    - DEBUG: pool: improve decoding of corrupted pools
    - REORG: pool: move the area dump with symbol resolution to tools.c
    - DEBUG: pools: report the data around the offending area in case of mismatch
    - MINOR: listener/protocol: add proto name in alerts
    - MINOR: proto_quic: add proto name in alert
    - BUG/MINOR: lru: fix the standalone test case for invalid revision
    - DOC: management: fix typos
    - CI: revert kernel addr randomization introduced in 3a0fc864
    - MINOR: ring: clarify the usage of ring_size() and add ring_allocated_size()
    - BUG/MAJOR: ring: use the correct size to reallocate startup_logs
    - MINOR: ring: always check that the old ring fits in the new one in ring_dup()
    - CLEANUP: ssl: remove dead code in cfg_parse_crtstore()
    - MINOR: ssl: supports crt-base in crt-store
    - MINOR: ssl: 'key-base' allows to load a 'key' from a specific path
    - MINOR: net_helper: Add support for floats/doubles.
    - BUG/MEDIUM: grpc: Fix several unaligned 32/64 bits accesses
    - MINOR: peers: Split resync process function to separate running/stopping states
    - MINOR: peers: Add 2 peer flags about the peer learn status
    - MINOR: peers: Add flags to report the peer state to the resync task
    - MINOR: peers: sligthly adapt part processing the stopping signal
    - MINOR: peers: Add functions to commit peer changes from the resync task
    - BUG/MINOR: peers: Report a resync was explicitly requested from a thread-safe manner
    - BUG/MAJOR: peers: Update peers section state from a thread-safe manner
    - MEDIUM: peers: Only lock one peer at a time in the sync process function
    - MINOR: peer: Restore previous peer flags value to ease debugging
    - BUG/MEDIUM: stconn: Don't forward channel data if input data must be filtered
    - BUILD: cache: fix a build warning with gcc < 7
    - BUILD: xxhash: silence a build warning on Solaris + gcc-5.5
    - CI: reduce ASAN log redirection umbrella size
    - CLEANUP: assorted typo fixes in the code and comments
    - BUG/MEDIUM: evports: do not clear returned events list on signal
    - MEDIUM: evports: permit to report multiple events at once
    - MEDIUM: ssl: support aliases in crt-store
    - BUG/MINOR: ssl: check on forbidden character on wrong value
    - BUG/MINOR: ssl: fix crt-store load parsing
    - BUG/MEDIUM: applet: Fix applet API to put input data in a buffer
    - BUG/MEDIUM: spoe: Always retry when an applet fails to send a frame
    - BUG/MEDIUM: peers: Fix exit condition when max-updates-at-once is reached
    - BUILD: linuxcap: Properly declare prepare_caps_from_permitted_set()
    - BUG/MEDIUM: peers: fix localpeer regression with 'bind+server' config style
    - MINOR: peers: stop relying on srv->addr to find peer port
    - MEDIUM: ssl: support a named crt-store section
    - MINOR: stats: remove implicit static trash_chunk usage
    - REORG: stats: extract HTML related functions
    - REORG: stats: extract JSON related functions
    - MEDIUM: ssl: crt-base and key-base local keywords for crt-store
    - MINOR: stats: Get the right prototype for stats_dump_html_end().
    - MAJOR: ssl: use the msg callback mecanism for backend connections
    - MINOR: ssl: implement keylog fetches for backend connections
    - BUG/MINOR: stconn: Fix sc_mux_strm() return value
    - MINOR: mux-pt: Test conn flags instead of sedesc ones to perform a full close
    - MINOR: stconn/connection: Move shut modes at the SE descriptor level
    - MINOR: stconn: Rewrite shutdown functions to simplify the switch statements
    - MEDIUM: stconn: Use only one SC function to shut connection endpoints
    - MEDIUM: stconn: Explicitly pass shut modes to shut applet endpoints
    - MEDIUM: stconn: Use one function to shut connection and applet endpoints
    - MEDIUM: muxes: Use one callback function to shut a mux stream
    - BUG/MINOR: sock: handle a weird condition with connect()
    - BUG/MINOR: fd: my_closefrom() on Linux could skip contiguous series of sockets
    - BUG/MEDIUM: peers: Don't set PEERS_F_RESYNC_PROCESS flag on a peer
    - BUG/MEDIUM: peers: Fix state transitions of a peer
    - MINOR: init: use RLIMIT_DATA instead of RLIMIT_AS
    - CI: modernize macos matrix

14 months agoCI: modernize macos matrix
Ilya Shipitsin [Fri, 19 Apr 2024 05:16:45 +0000 (07:16 +0200)] 
CI: modernize macos matrix

let's stick to macos-13 for stable branches and macos-14 for development branches.
since macos-14 is available for Apple Silicon, some modifications are required
for VTest (should be ported to VTest later)

news: https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-available/

14 months agoMINOR: init: use RLIMIT_DATA instead of RLIMIT_AS
Valentine Krasnobaeva [Thu, 18 Apr 2024 13:38:58 +0000 (15:38 +0200)] 
MINOR: init: use RLIMIT_DATA instead of RLIMIT_AS

Limiting total allocatable process memory (VSZ) via setting RLIMIT_AS limit is
no longer effective, in order to restrict memory consumption at run time.
We can see from process memory map below, that there are many holes within
the process VA space, which bumps its VSZ to 1.5G. These holes are here by
many reasons and could be explaned at first by the full randomization of
system VA space. Now it is usually enabled in Linux kernels by default. There
are always gaps around the process stack area to trap overflows. Holes before
and after shared libraries could be explained by the fact, that on many
architectures libraries have a 'preferred' address to be loaded at; putting
them elsewhere requires relocation work, and probably some unshared pages.
Repetitive holes of 65380K are most probably correspond to the header that
malloc has to allocate before asked a claimed memory block. This header is
used by malloc to link allocated chunks together and for its internal book
keeping.

$ sudo pmap -x -p `pidof haproxy`
127136:   ./haproxy -f /home/haproxy/haproxy/haproxy_h2.cfg
Address           Kbytes     RSS   Dirty Mode  Mapping
0000555555554000     388      64       0 r---- /home/haproxy/haproxy/haproxy
00005555555b5000    2608    1216       0 r-x-- /home/haproxy/haproxy/haproxy
0000555555841000     916      64       0 r---- /home/haproxy/haproxy/haproxy
0000555555926000      60      60      60 r---- /home/haproxy/haproxy/haproxy
0000555555935000     116     116     116 rw--- /home/haproxy/haproxy/haproxy
0000555555952000    7872    5236    5236 rw---   [ anon ]
00007fff98000000     156      36      36 rw---   [ anon ]
00007fff98027000   65380       0       0 -----   [ anon ]
00007fffa0000000     156      36      36 rw---   [ anon ]
00007fffa0027000   65380       0       0 -----   [ anon ]
00007fffa4000000     156      36      36 rw---   [ anon ]
00007fffa4027000   65380       0       0 -----   [ anon ]
00007fffa8000000     156      36      36 rw---   [ anon ]
00007fffa8027000   65380       0       0 -----   [ anon ]
00007fffac000000     156      36      36 rw---   [ anon ]
00007fffac027000   65380       0       0 -----   [ anon ]
00007fffb0000000     156      36      36 rw---   [ anon ]
00007fffb0027000   65380       0       0 -----   [ anon ]
...
00007ffff7fce000       4       4       0 r-x--   [ anon ]
00007ffff7fcf000       4       4       0 r---- /usr/lib/x86_64-linux-gnu/ld-2.31.so
00007ffff7fd0000     140     140       0 r-x-- /usr/lib/x86_64-linux-gnu/ld-2.31.so
...
00007ffff7ffe000       4       4       4 rw---   [ anon ]
00007ffffffde000     132      20      20 rw---   [ stack ]
ffffffffff600000       4       0       0 --x--   [ anon ]
---------------- ------- ------- -------
total kB         1499288   75504   72760

This exceeded VSZ makes impossible to start an haproxy process with 200M
memory limit, set at its initialization stage as RLIMIT_AS. We usually
have in this case such cryptic output at stderr:

$ haproxy -m 200 -f haproxy_quic.cfg
        (null)(null)(null)(null)(null)(null)

At the same time the process RSS (a memory really used) is only 75,5M.
So to make process memory accounting more realistic let's base the memory
limit, set by -m option, on RSS measurement and let's use RLIMIT_DATA instead
of RLIMIT_AS.

RLIMIT_AS was used before, because earlier versions of haproxy always allocate
memory buffers for new connections, but data were not written there
immediately. So these buffers were not instantly counted in RSS, but were
always counted in VSZ. Now we allocate new buffers only in the case, when we
will write there some data immediately, so using RLIMIT_DATA becomes more
appropriate.

14 months agoBUG/MEDIUM: peers: Fix state transitions of a peer
Christopher Faulet [Fri, 19 Apr 2024 14:50:08 +0000 (16:50 +0200)] 
BUG/MEDIUM: peers: Fix state transitions of a peer

The commit 9425aeaffb ("BUG/MAJOR: peers: Update peers section state from a
thread-safe manner") introduced regressions about state transitions of a
peer.

A peer may be in a connected, accepted or released state. Before, changes for
these states were performed synchronously. Since the commit above, changes
are mainly performed in the sync process task.

The first regression was about the released then accepted state transition,
called the renewed state. In reality the state was always crushed by the
accepted state. After some review, the state was just removed to always
perform the cleanup in the sync process task before acknowledging the
connected or accepted states.

Then, a wakeup of the peer applet was missing from the sync process task
after the ack of connected or accepted states, blocking the applet.

Finally, when a peer is in released, connected or accepted state, we must
take care to wait the sync process task wakeup before trying to receive or
send messages.

This patch must only be backported if the above commit is backported.

14 months agoBUG/MEDIUM: peers: Don't set PEERS_F_RESYNC_PROCESS flag on a peer
Christopher Faulet [Fri, 19 Apr 2024 13:39:52 +0000 (15:39 +0200)] 
BUG/MEDIUM: peers: Don't set PEERS_F_RESYNC_PROCESS flag on a peer

The bug was introduced by commit 9425aeaffb ("BUG/MAJOR: peers: Update peers
section state from a thread-safe manner"). A peers flags was set on a peer
by error. Just remove it.

This patch must only be backported if the above commit is backported.

14 months agoBUG/MINOR: fd: my_closefrom() on Linux could skip contiguous series of sockets
Willy Tarreau [Fri, 19 Apr 2024 14:52:32 +0000 (16:52 +0200)] 
BUG/MINOR: fd: my_closefrom() on Linux could skip contiguous series of sockets

We got a detailed report analysis showing that our optimization consisting
in using poll() to detect already closed FDs within a 1024 range has an
issue with the case where 1024 consecutive FDs are open (hence do not show
POLLNVAL) and none of them has any activity report. In this case poll()
returns zero update and we would just skip the loop that inspects all the
FDs to close the valid ones. One visible effect is that the called programs
might occasionally see some FDs being exposed in the low range of their fd
space, possibly making the process run out of FDs when trying to open a
file for example.

Note that this is actually a fix for commit b8e602cb1b ("BUG/MINOR: fd:
make sure my_closefrom() doesn't miss some FDs") that already faced a
more common form of this problem (incomplete but non-empty FDs reported).

This can be backported up to 2.0.

14 months agoBUG/MINOR: sock: handle a weird condition with connect()
Willy Tarreau [Tue, 9 Apr 2024 06:03:10 +0000 (08:03 +0200)] 
BUG/MINOR: sock: handle a weird condition with connect()

As reported on github issue #2491, there's a very strange situation where
epoll_wait() appears to be reported EPOLLERR only (and not IN/OUT/HUP etc
as normally happens with EPOLLERR), and when connect() is called again to
check the state of the ongoing connection, it returns EALREADY, basically
saying "no news, please wait". This obviously triggers a wakeup loop. For
now it has remained impossible to reproduce this issue outside of the
reporter's environment, but that's definitely something that is impossible
to get out from.

The workaround here is to address the lowest level cause we can act on,
which is to avoid returning to wait if EPOLLERR was returned. Indeed, in
this case we know it will loop, so we must definitely take this one into
account. We only do that after connect() asks us to wait, so that a
properly established connection with a queued error at the end of an
exchange will not be diverted and will be handled as usual.

This should be backported to approximately all versions, at least as far
as 2.4 according to the reporter who observed it there.

Thanks to @donnyxray for their useful captures isolating the problem.

14 months agoMEDIUM: muxes: Use one callback function to shut a mux stream
Christopher Faulet [Thu, 18 Apr 2024 07:56:11 +0000 (09:56 +0200)] 
MEDIUM: muxes: Use one callback function to shut a mux stream

mux-ops .shutr and .shutw callback functions are merged into a unique
functions, called .shut. The shutdown mode is still passed as argument,
muxes are responsible to test it. Concretly, .shut() function of each mux is
now the content of the old .shutw() followed by the content of the old
.shutr().

14 months agoMEDIUM: stconn: Use one function to shut connection and applet endpoints
Christopher Faulet [Tue, 16 Apr 2024 16:36:40 +0000 (18:36 +0200)] 
MEDIUM: stconn: Use one function to shut connection and applet endpoints

se_shutdown() function is now used to perform a shutdown on a connection
endpoint and an applet endpoint. The same function is used for
both. sc_conn_shut() function was removed and appctx_shut() function was
updated to only deal with the applet stuff.

14 months agoMEDIUM: stconn: Explicitly pass shut modes to shut applet endpoints
Christopher Faulet [Tue, 16 Apr 2024 16:07:43 +0000 (18:07 +0200)] 
MEDIUM: stconn: Explicitly pass shut modes to shut applet endpoints

It is the same than the previous patch but for applets. Here there is
already only one function. But with this patch, appctx_shut() function was
modified to explicitly get shutdown mode as parameter. In addition
appctx_shutw() was removed.

14 months agoMEDIUM: stconn: Use only one SC function to shut connection endpoints
Christopher Faulet [Tue, 16 Apr 2024 15:42:38 +0000 (17:42 +0200)] 
MEDIUM: stconn: Use only one SC function to shut connection endpoints

The SC API to perform shutdowns on connection endpoints was unified to have
only one function, sc_conn_shut(), with read/write shut modes passed
explicitly. It means sc_conn_shutr() and sc_conn_shutw() were removed. The
next step is to do the same at the mux level.

14 months agoMINOR: stconn: Rewrite shutdown functions to simplify the switch statements
Christopher Faulet [Tue, 16 Apr 2024 14:26:49 +0000 (16:26 +0200)] 
MINOR: stconn: Rewrite shutdown functions to simplify the switch statements

To ease shutdown API refactoring, shutdown callback functions were
simplified. The fallthrough were removed from the switch statements.

14 months agoMINOR: stconn/connection: Move shut modes at the SE descriptor level
Christopher Faulet [Tue, 16 Apr 2024 06:51:56 +0000 (08:51 +0200)] 
MINOR: stconn/connection: Move shut modes at the SE descriptor level

CO_SHR_* and CO_SHW_* modes are in fact used by the stream-connectors to
instruct the muxes how streams must be shut done. It is then the mux
responsibility to decide if it must be propagated to the connection layer or
not. And in this case, the modes above are only tested to pass a boolean
(clean or not).

So, it is not consistant to still use connection related modes for
information set at an upper layer and never used by the connection layer
itself.

These modes are thus moved at the sedesc level and merged into a single
enum. Idea is to add more modes, not necessarily mutually exclusive, to pass
more info to the muxes. For now, it is a one-for-one renaming.

14 months agoMINOR: mux-pt: Test conn flags instead of sedesc ones to perform a full close
Christopher Faulet [Tue, 16 Apr 2024 06:22:36 +0000 (08:22 +0200)] 
MINOR: mux-pt: Test conn flags instead of sedesc ones to perform a full close

In .shutr and .shutw callback functions, we must rely on the connection
flags (CO_FL_SOCK_RD_SH/WR_SH) to decide to fully close the connection
instead of using sedesc flags. At the end, for the PT multiplexer, it is
equivalent. But it is more logicial and consistent this way.

14 months agoBUG/MINOR: stconn: Fix sc_mux_strm() return value
Christopher Faulet [Fri, 19 Apr 2024 13:29:57 +0000 (15:29 +0200)] 
BUG/MINOR: stconn: Fix sc_mux_strm() return value

Since the begining, this function returns a pointer on an appctx while it
should be a void pointer. It is the caller responsibility to cast it to the
right type, the corresponding mux stream in this case.

However, it is not a big deal because this function is unused for now. Only
the unsafe one is used.

This patch must be backported as far as 2.6.

14 months agoMINOR: ssl: implement keylog fetches for backend connections
William Lallemand [Fri, 19 Apr 2024 12:29:05 +0000 (14:29 +0200)] 
MINOR: ssl: implement keylog fetches for backend connections

This patch implements the backend side of the keylog fetches.
The code was ready but needed the SSL message callbacks.

This could be used like this:

 log-format "CLIENT_EARLY_TRAFFIC_SECRET %[ssl_bc_client_random,hex] %[ssl_bc_client_early_traffic_secret]\n
             CLIENT_HANDSHAKE_TRAFFIC_SECRET %[ssl_bc_client_random,hex] %[ssl_bc_client_handshake_traffic_secret]\n
             SERVER_HANDSHAKE_TRAFFIC_SECRET %[ssl_bc_client_random,hex] %[ssl_bc_server_handshake_traffic_secret]\n
             CLIENT_TRAFFIC_SECRET_0 %[ssl_bc_client_random,hex] %[ssl_bc_client_traffic_secret_0]\n
             SERVER_TRAFFIC_SECRET_0 %[ssl_bc_client_random,hex] %[ssl_bc_server_traffic_secret_0]\n
             EXPORTER_SECRET %[ssl_bc_client_random,hex] %[ssl_bc_exporter_secret]\n
             EARLY_EXPORTER_SECRET %[ssl_bc_client_random,hex] %[ssl_bc_early_exporter_secret]"

14 months agoMAJOR: ssl: use the msg callback mecanism for backend connections
William Lallemand [Fri, 19 Apr 2024 12:18:32 +0000 (14:18 +0200)] 
MAJOR: ssl: use the msg callback mecanism for backend connections

Backend SSL connections never used the ssl_sock_msg_callbacks() which
prevent the use of keylog on the server side.

The impact should be minimum, though it add a major callback system for
protocol analysis, which is the same used on frontend connections.

https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_msg_callback.html

The patch add a call to SSL_CTX_set_msg_callback() in
ssl_sock_prepare_srv_ssl_ctx() the same way it's done for bind lines in
ssl_sock_prepare_ctx().

14 months agoMINOR: stats: Get the right prototype for stats_dump_html_end().
Olivier Houchard [Thu, 18 Apr 2024 23:49:12 +0000 (01:49 +0200)] 
MINOR: stats: Get the right prototype for stats_dump_html_end().

When the stat code was reorganized, and the prototype to
stats_dump_html_end() was moved to its own header, it missed the function
arguments. Fix that.

This should fix issue 2540.

14 months agoMEDIUM: ssl: crt-base and key-base local keywords for crt-store
William Lallemand [Thu, 18 Apr 2024 15:24:58 +0000 (17:24 +0200)] 
MEDIUM: ssl: crt-base and key-base local keywords for crt-store

Add support for crt-base and key-base local keywords for the crt-store.

current_crtbase and current_keybase are filed with a copy of the global
keyword argument when a crt-store is declared, and updated with a new
path when the keywords are in the crt-store section.

The ckch_conf_kws[] array was updated with &current_crtbase and
&current_keybase instead of the global_ssl ones so the parser can use
them.

The keyword must be used before any "load" line in a crt-store section.

Example:

    crt-store web
        crt-base /etc/ssl/certs/
        key-base /etc/ssl/private/
        load crt "site3.crt" alias "site3"
        load crt "site4.crt" key "site4.key"

    frontend in2
        bind *:443 ssl crt "@web/site3" crt "@web/site4.crt"

14 months agoREORG: stats: extract JSON related functions
Amaury Denoyelle [Tue, 16 Apr 2024 12:57:54 +0000 (14:57 +0200)] 
REORG: stats: extract JSON related functions

This commit is similar to the previous one. This time it deals with
functions related to stats JSON output.

14 months agoREORG: stats: extract HTML related functions
Amaury Denoyelle [Tue, 16 Apr 2024 09:21:06 +0000 (11:21 +0200)] 
REORG: stats: extract HTML related functions

Extract functions related to HTML stats webpage from stats.c into a new
module named stats-html. This allows to reduce stats.c to roughly half
of its original size.

14 months agoMINOR: stats: remove implicit static trash_chunk usage
Amaury Denoyelle [Thu, 18 Apr 2024 14:13:48 +0000 (16:13 +0200)] 
MINOR: stats: remove implicit static trash_chunk usage

A static variable trash_chunk was used as implicit buffer in most of
stats output function. It was a oneline buffer uses as temporary storage
before emitting to the final applet or CLI buffer.

Replaces it by a buffer defined in show_stat_ctx structure. This allows
to retrieve it in most of stats output function. An additional parameter
was added for the function where context was not already used. This
renders the code cleaner and will allow to split stats.c in several
source files.

As a result of a new member into show_stat_ctx, per-command context max
size has increased. This forces to increase APPLET_MAX_SVCCTX to ensure
pool size is big enough. Increase it to 128 bytes which includes some
extra room for the future.

14 months agoMEDIUM: ssl: support a named crt-store section
William Lallemand [Thu, 18 Apr 2024 13:54:16 +0000 (15:54 +0200)] 
MEDIUM: ssl: support a named crt-store section

This patch introduces named crt-store section. A named crt-store allows
to add a scope to the crt name.

For example, a crt named "foo.crt" in a crt-store named "web" will
result in a certificate called "@web/foo.crt".