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.
This commit is contained in:
Christopher Faulet 2019-06-12 16:07:48 +02:00
parent 3cec0f94f3
commit 647fe1d9e1

View File

@ -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) - "