Skip to content

Commit

Permalink
fix digitalocean#64: failed build against newer libmicrohttpd versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Filip Chabik committed Oct 8, 2021
1 parent c57034d commit 24d9bf1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions promhttp/src/promhttp.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,13 @@ void promhttp_set_active_collector_registry(prom_collector_registry_t *active_re
}
}

#if MHD_VERSION >= 0x00097002
enum MHD_Result promhttp_handler(void *cls, struct MHD_Connection *connection, const char *url, const char *method,
const char *version, const char *upload_data, size_t *upload_data_size, void **con_cls) {
#else
int promhttp_handler(void *cls, struct MHD_Connection *connection, const char *url, const char *method,
const char *version, const char *upload_data, size_t *upload_data_size, void **con_cls) {
#endif
if (strcmp(method, "GET") != 0) {
char *buf = "Invalid HTTP Method\n";
struct MHD_Response *response = MHD_create_response_from_buffer(strlen(buf), (void *)buf, MHD_RESPMEM_PERSISTENT);
Expand Down

0 comments on commit 24d9bf1

Please sign in to comment.