projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
write_prometheus: add support for libmicrohttpd 0.9.45+
[collectd.git]
/
src
/
write_prometheus.c
diff --git
a/src/write_prometheus.c
b/src/write_prometheus.c
index
6c88278
..
6fb5a86
100644
(file)
--- a/
src/write_prometheus.c
+++ b/
src/write_prometheus.c
@@
-210,8
+210,14
@@
static int http_handler(void *cls, struct MHD_Connection *connection,
else
format_text(buffer);
else
format_text(buffer);
- struct MHD_Response *res = MHD_create_response_from_data(
+ struct MHD_Response *res =
+#if defined(MHD_VERSION) && MHD_VERSION >= 0x00090500
+ MHD_create_response_from_buffer(
+ simple.len, simple.data, MHD_RESPMEM_MUST_COPY);
+#else
+ MHD_create_response_from_data(
simple.len, simple.data, /* must_free = */ 0, /* must_copy = */ 1);
simple.len, simple.data, /* must_free = */ 0, /* must_copy = */ 1);
+#endif
MHD_add_response_header(res, MHD_HTTP_HEADER_CONTENT_TYPE,
want_proto ? CONTENT_TYPE_PROTO : CONTENT_TYPE_TEXT);
MHD_add_response_header(res, MHD_HTTP_HEADER_CONTENT_TYPE,
want_proto ? CONTENT_TYPE_PROTO : CONTENT_TYPE_TEXT);