Skip to content

Commit

Permalink
Fix build with µhttpd 0.9.71
Browse files Browse the repository at this point in the history
The return type of callbacks was changed from int to an enum.
  • Loading branch information
keszybz authored and yuwata committed Jul 1, 2020
1 parent 116739c commit d17eabb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/journal-remote/journal-gatewayd.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ static int request_parse_range(
return 0;
}

static int request_parse_arguments_iterator(
static mhd_result request_parse_arguments_iterator(
void *cls,
enum MHD_ValueKind kind,
const char *key,
Expand Down Expand Up @@ -796,7 +796,7 @@ static int request_handler_machine(
return MHD_queue_response(connection, MHD_HTTP_OK, response);
}

static int request_handler(
static mhd_result request_handler(
void *cls,
struct MHD_Connection *connection,
const char *url,
Expand Down
2 changes: 1 addition & 1 deletion src/journal-remote/journal-remote-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ static int process_http_upload(
return mhd_respond(connection, MHD_HTTP_ACCEPTED, "OK.");
};

static int request_handler(
static mhd_result request_handler(
void *cls,
struct MHD_Connection *connection,
const char *url,
Expand Down
6 changes: 6 additions & 0 deletions src/journal-remote/microhttpd-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@
# define MHD_create_response_from_fd_at_offset64 MHD_create_response_from_fd_at_offset
#endif

#if MHD_VERSION >= 0x00097002
# define mhd_result enum MHD_Result
#else
# define mhd_result int
#endif

void microhttpd_logger(void *arg, const char *fmt, va_list ap) _printf_(2, 0);

/* respond_oom() must be usable with return, hence this form. */
Expand Down

0 comments on commit d17eabb

Please sign in to comment.