From: Christopher Faulet Date: Wed, 12 Jun 2019 14:07:48 +0000 (+0200) Subject: BUG/MINOR: fl_trace/htx: Be sure to always forward trailers and EOM X-Git-Tag: v2.0.0~45 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=647fe1d9e1359072021c15c459f728bdc348236d;p=thirdparty%2Fhaproxy.git BUG/MINOR: fl_trace/htx: Be sure to always forward trailers and EOM Previous fix about the random forwarding on the message body was not enough to fix the bug in all cases. Among others, when there is no data but only the EOM, we must forward everything. This patch must be backported to 1.9 if the patch 0bdeeaacb ("BUG/MINOR: flt_trace/htx: Only apply the random forwarding on the message body.") is also backported. --- diff --git a/src/flt_trace.c b/src/flt_trace.c index cd69145614..c0660acab1 100644 --- a/src/flt_trace.c +++ b/src/flt_trace.c @@ -486,10 +486,11 @@ trace_http_payload(struct stream *s, struct filter *filter, struct http_msg *msg break; } } - - ret = random() % (ret+1); - if (ret > data) - ret = len; + if (data) { + ret = random() % (ret+1); + if (!ret || ret >= data) + ret = len; + } } STRM_TRACE(conf, s, "%-25s: channel=%-10s - mode=%-5s (%s) - "