From: Aurelien DARRAGON Date: Thu, 31 Aug 2023 06:37:36 +0000 (+0200) Subject: MEDIUM: sink: don't perform implicit truncations when maxlen is not set X-Git-Tag: v2.9-dev5~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=32f1db6d0d43452e6a2a353565e5dbb207d6a2dd;p=thirdparty%2Fhaproxy.git 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). --- diff --git a/src/sink.c b/src/sink.c index 178afcb8cb..bbab059442 100644 --- a/src/sink.c +++ b/src/sink.c @@ -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",