]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journal-remote: update to 64bit µhttp api, provide fallback 2357/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 15 Jan 2016 19:58:50 +0000 (14:58 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 18 Jan 2016 20:21:28 +0000 (15:21 -0500)
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
src/journal-remote/microhttpd-util.h

index bd35506f52c871f3ac01cc93e9ed3b2a25a7ba72..7120a08e502bda1eada57a914c4119c35298949f 100644 (file)
@@ -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);
 
index 9b56434cba3e55d9dabfbbf3559d8074400ad11d..cba57403a3f13180d711e93f965150e0449bcfdd 100644 (file)
 #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. */