From b3b0c23a56a2506a0d181af2f1775e3a98966c49 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 15 Jan 2016 14:58:50 -0500 Subject: [PATCH] =?utf8?q?journal-remote:=20update=20to=2064bit=20=C2=B5ht?= =?utf8?q?tp=20api,=20provide=20fallback?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 64 bit offset is now accepted, which is nice. The old function is deprecated, and generates a compile time warning when used. We only use an offset of 0, so we really don't care. Adapt to use the new function, but fall back to the old one on older versions. --- src/journal-remote/journal-gatewayd.c | 2 +- src/journal-remote/microhttpd-util.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/journal-remote/journal-gatewayd.c b/src/journal-remote/journal-gatewayd.c index bd35506f52c..7120a08e502 100644 --- a/src/journal-remote/journal-gatewayd.c +++ b/src/journal-remote/journal-gatewayd.c @@ -700,7 +700,7 @@ static int request_handler_file( if (fstat(fd, &st) < 0) return mhd_respondf(connection, MHD_HTTP_INTERNAL_SERVER_ERROR, "Failed to stat file: %m\n"); - response = MHD_create_response_from_fd_at_offset(st.st_size, fd, 0); + response = MHD_create_response_from_fd_at_offset64(st.st_size, fd, MHD_VERSION); if (!response) return respond_oom(connection); diff --git a/src/journal-remote/microhttpd-util.h b/src/journal-remote/microhttpd-util.h index 9b56434cba3..cba57403a3f 100644 --- a/src/journal-remote/microhttpd-util.h +++ b/src/journal-remote/microhttpd-util.h @@ -31,6 +31,10 @@ #define MHD_HTTP_NOT_ACCEPTABLE MHD_HTTP_METHOD_NOT_ACCEPTABLE #endif +#if MHD_VERSION < 0x00094203 +#define MHD_create_response_from_fd_at_offset64 MHD_create_response_from_fd_at_offset +#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. */ -- 2.47.3