MEDIUM: sink: don't perform implicit truncations when maxlen is not set

maxlen now defaults ~0 (instead of BUFSIZE) to make sure no implicit
truncation will be performed when the option is not specified, since the
doc doesn't mention any default value for maxlen. As such, if the payload
is too big, it will be dropped (this is the default expected behavior).
This commit is contained in:
Aurelien DARRAGON 2023-08-31 08:37:36 +02:00 committed by Christopher Faulet
parent fdf82d058b
commit 32f1db6d0d

View File

@ -1190,7 +1190,7 @@ int cfg_post_parse_ring()
if (cfg_sink && (cfg_sink->type == SINK_TYPE_BUFFER)) {
if (!cfg_sink->maxlen)
cfg_sink->maxlen = BUFSIZE; // maxlen not set: use default value
cfg_sink->maxlen = ~0; // maxlen not set: no implicit truncation
else if (cfg_sink->maxlen > ring_max_payload(cfg_sink->ctx.ring)) {
/* maxlen set by user however it doesn't fit: set to max value */
ha_warning("ring '%s' event max length '%u' exceeds max payload size, forced to '%lu'.\n",