]> git.ipfire.org Git - thirdparty/FORT-validator.git/commitdiff
Fix libmicrohttpd <= 0.9.60 API usage
authorAlberto Leiva Popper <ydahhrk@gmail.com>
Thu, 7 Aug 2025 18:12:43 +0000 (12:12 -0600)
committerAlberto Leiva Popper <ydahhrk@gmail.com>
Thu, 7 Aug 2025 18:12:43 +0000 (12:12 -0600)
Should now work for libmicrohttpd 0.9.16 to 1.0.2.

For #50.

src/prometheus.c

index 0ebfed20b305000b65aa2bcccaa36bfe7c531086..561a443eb9f37e853fbcd54419b547a588f00a91 100644 (file)
@@ -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) {