From: Alberto Leiva Popper Date: Thu, 7 Aug 2025 18:12:43 +0000 (-0600) Subject: Fix libmicrohttpd <= 0.9.60 API usage X-Git-Tag: 1.6.7~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e0f64d4dcb8c9cf5b977903d6af1413fb7a9c08f;p=thirdparty%2FFORT-validator.git Fix libmicrohttpd <= 0.9.60 API usage Should now work for libmicrohttpd 0.9.16 to 1.0.2. For #50. --- diff --git a/src/prometheus.c b/src/prometheus.c index 0ebfed20..561a443e 100644 --- a/src/prometheus.c +++ b/src/prometheus.c @@ -41,8 +41,13 @@ send_metrics(struct MHD_Connection *conn) pr_op_debug("Handling Prometheus request..."); stats = stats_export(); +#if MHD_VERSION > 0x00096000 res = MHD_create_response_from_buffer_with_free_callback(strlen(stats), stats, free); +#else + res = MHD_create_response_from_buffer(strlen(stats), stats, + MHD_RESPMEM_MUST_FREE); +#endif ret = MHD_add_response_header(res, "Content-Type", CONTENT_TYPE); if (ret != MHD_YES) {