From: Christopher Faulet Date: Tue, 28 May 2019 19:56:07 +0000 (+0200) Subject: BUG/MINOR: contrib/prometheus-exporter: Add HTX data block in one time X-Git-Tag: v2.0-dev6~40 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=142b5df7784181e4081a10e25bdd9161546d9594;p=thirdparty%2Fhaproxy.git BUG/MINOR: contrib/prometheus-exporter: Add HTX data block in one time Since recent changes on the way HTX data blocks are added in an HTX message, we must now be sure the prometheus service add its own blocks in one time. Indeed, the function htx_add_data() may now decide to only copy a part of data. So instead, we must call htx_add_data_atonce() instead. --- diff --git a/contrib/prometheus-exporter/service-prometheus.c b/contrib/prometheus-exporter/service-prometheus.c index 3071b8f0fe..483e7031f1 100644 --- a/contrib/prometheus-exporter/service-prometheus.c +++ b/contrib/prometheus-exporter/service-prometheus.c @@ -1409,7 +1409,7 @@ static int promex_dump_global_metrics(struct appctx *appctx, struct htx *htx) } end: - if (!htx_add_data(htx, out)) + if (!htx_add_data_atonce(htx, out)) return -1; /* Unexpected and unrecoverable error */ channel_add_input(chn, out.len); return ret; @@ -1587,7 +1587,7 @@ static int promex_dump_front_metrics(struct appctx *appctx, struct htx *htx) } end: - if (!htx_add_data(htx, out)) + if (!htx_add_data_atonce(htx, out)) return -1; /* Unexpected and unrecoverable error */ channel_add_input(chn, out.len); return ret; @@ -1805,7 +1805,7 @@ static int promex_dump_back_metrics(struct appctx *appctx, struct htx *htx) } end: - if (!htx_add_data(htx, out)) + if (!htx_add_data_atonce(htx, out)) return -1; /* Unexpected and unrecoverable error */ channel_add_input(chn, out.len); return ret; @@ -1999,7 +1999,7 @@ static int promex_dump_srv_metrics(struct appctx *appctx, struct htx *htx) end: - if (!htx_add_data(htx, out)) + if (!htx_add_data_atonce(htx, out)) return -1; /* Unexpected and unrecoverable error */ channel_add_input(chn, out.len); return ret;