]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: sink: don't perform implicit truncations when maxlen is not set
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 31 Aug 2023 06:37:36 +0000 (08:37 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 6 Sep 2023 14:06:39 +0000 (16:06 +0200)
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).

src/sink.c

index 178afcb8cb8b1e89f48c3d92dbf2082f5e1e198c..bbab05944265380e921a3636a9babf9e86dbd03e 100644 (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",