]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: contrib/prometheus-exporter: Fix applet accordingly to recent changes
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 27 Mar 2019 14:48:53 +0000 (15:48 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 27 Mar 2019 15:08:32 +0000 (16:08 +0100)
commit9744f7c1265e96f382f51aae4184a3528ea9163f
tree2954ed76ec5c2554bab1e62d57db4298227776aa
parentb7405c1c5071bb17154a625fbc5b46da5c6a9cf4
BUG/MINOR: contrib/prometheus-exporter: Fix applet accordingly to recent changes

Since the flag EOI was added on channels, some hidden bugs in the prometheus
exporter now leads to error. the visible effect is that responses are
truncated.

So first of all, channel_add_input() must be called when the response headers
and the EOM block are added. To be sure to correctly update the response channel
(especially to_forward value). Then the request must really be fully
consumed. And finally, the return clause in the switch has been replaced by a
break. It was totally wrong to skip the end of the function in the states
PROMEX_DONE and PROMEX_ERROR. (Note that PROMEX_ERROR was never used, so it was
replaced by PROMEX_END just to ease reading the code).

No need to backport this patch, the Prometheus exporter does not exist in early
versions.
contrib/prometheus-exporter/service-prometheus.c