From 142b5df7784181e4081a10e25bdd9161546d9594 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Tue, 28 May 2019 21:56:07 +0200 Subject: [PATCH] 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. --- contrib/prometheus-exporter/service-prometheus.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/prometheus-exporter/service-prometheus.c b/contrib/prometheus-exporter/service-prometheus.c index 3071b8f0f..483e7031f 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;