From 424bb6c3f56f6c445b7bd3d06150ab2993f1b611 Mon Sep 17 00:00:00 2001 From: Shuicheng Lin Date: Tue, 8 Jan 2019 20:59:43 +0800 Subject: [PATCH] Fix compile failure due to deprecated value Issue occur after upgrade build tool chain. Fix it per tool chain's suggestion. Error message is like below: " Value MHD_HTTP_REQUEST_ENTITY_TOO_LARGE is deprecated, use MHD_HTTP_PAYLOAD_TOO_LARGE [-Werror] Value MHD_HTTP_METHOD_NOT_ACCEPTABLE is deprecated, use MHD_HTTP_NOT_ACCEPTABLE [-Werror] " Signed-off-by: Shuicheng Lin --- src/journal-remote/journal-gatewayd.c | 4 ++-- src/journal-remote/journal-remote.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/journal-remote/journal-gatewayd.c b/src/journal-remote/journal-gatewayd.c index d1f0ce3..8364044 100644 --- a/src/journal-remote/journal-gatewayd.c +++ b/src/journal-remote/journal-gatewayd.c @@ -684,7 +684,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, 0); if (!response) return respond_oom(connection); @@ -824,7 +824,7 @@ static int request_handler( assert(method); if (!streq(method, "GET")) - return mhd_respond(connection, MHD_HTTP_METHOD_NOT_ACCEPTABLE, + return mhd_respond(connection, MHD_HTTP_NOT_ACCEPTABLE, "Unsupported method.\n"); diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c index a455fb6..1d7df07 100644 --- a/src/journal-remote/journal-remote.c +++ b/src/journal-remote/journal-remote.c @@ -526,7 +526,7 @@ static int process_http_upload( log_warning("Failed to process data for connection %p", connection); if (r == -E2BIG) return mhd_respondf(connection, - MHD_HTTP_REQUEST_ENTITY_TOO_LARGE, + MHD_HTTP_PAYLOAD_TOO_LARGE, "Entry is too large, maximum is %u bytes.\n", DATA_SIZE_MAX); else @@ -579,7 +579,7 @@ static int request_handler( *connection_cls); if (!streq(method, "POST")) - return mhd_respond(connection, MHD_HTTP_METHOD_NOT_ACCEPTABLE, + return mhd_respond(connection, MHD_HTTP_NOT_ACCEPTABLE, "Unsupported method.\n"); if (!streq(url, "/upload")) -- 2.7.4