#include <libdwelf.h>
#include <microhttpd.h>
+
+#if MHD_VERSION >= 0x00097002
+// libmicrohttpd 0.9.71 broke API
+#define MHD_RESULT enum MHD_Result
+#else
+#define MHD_RESULT int
+#endif
+
#include <curl/curl.h>
#include <archive.h>
#include <archive_entry.h>
void report(ostream& o) const; // defined under obatched() class below
- int mhd_send_response(MHD_Connection* c) const {
+ MHD_RESULT mhd_send_response(MHD_Connection* c) const {
MHD_Response* r = MHD_create_response_from_buffer (message.size(),
(void*) message.c_str(),
MHD_RESPMEM_MUST_COPY);
MHD_add_response_header (r, "Content-Type", "text/plain");
- int rc = MHD_queue_response (c, code, r);
+ MHD_RESULT rc = MHD_queue_response (c, code, r);
MHD_destroy_response (r);
return rc;
}
/* libmicrohttpd callback */
-static int
+static MHD_RESULT
handler_cb (void * /*cls*/,
struct MHD_Connection *connection,
const char *url,
struct MHD_Response *r = NULL;
string url_copy = url;
+#if MHD_VERSION >= 0x00097002
+ enum MHD_Result rc;
+#else
int rc = MHD_NO; // mhd
+#endif
int http_code = 500;
off_t http_size = -1;
struct timeval tv_start, tv_end;