Skip to content

Commit

Permalink
journal-remote: use MHD_HTTP_CONTENT_TOO_LARGE as MHD_HTTP_PAYLOAD_TO…
Browse files Browse the repository at this point in the history
…O_LARGE is deprecated since 0.9.74

(cherry picked from commit 30df858)

Related: #2122499
  • Loading branch information
yuwata authored and jamacku committed Oct 3, 2022
1 parent deb09b3 commit ea9b3a6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
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 @@ -304,7 +304,7 @@ static int request_handler(
/* When serialized, an entry of maximum size might be slightly larger,
* so this does not correspond exactly to the limit in journald. Oh well.
*/
return mhd_respondf(connection, 0, MHD_HTTP_PAYLOAD_TOO_LARGE,
return mhd_respondf(connection, 0, MHD_HTTP_CONTENT_TOO_LARGE,
"Payload larger than maximum size of %u bytes", ENTRY_SIZE_MAX);
}

Expand Down
10 changes: 7 additions & 3 deletions src/journal-remote/microhttpd-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@
# define MHD_HTTP_NOT_ACCEPTABLE MHD_HTTP_METHOD_NOT_ACCEPTABLE
#endif

/* Renamed in µhttpd 0.9.53 */
#ifndef MHD_HTTP_PAYLOAD_TOO_LARGE
# define MHD_HTTP_PAYLOAD_TOO_LARGE MHD_HTTP_REQUEST_ENTITY_TOO_LARGE
/* Renamed in µhttpd 0.9.74 (8c644fc1f4d498ea489add8d40a68f5d3e5899fa) */
#ifndef MHD_HTTP_CONTENT_TOO_LARGE
# ifdef MHD_HTTP_PAYLOAD_TOO_LARGE
# define MHD_HTTP_CONTENT_TOO_LARGE MHD_HTTP_PAYLOAD_TOO_LARGE /* 0.9.53 or newer */
# else
# define MHD_HTTP_CONTENT_TOO_LARGE MHD_HTTP_REQUEST_ENTITY_TOO_LARGE
# endif
#endif

#if MHD_VERSION < 0x00094203
Expand Down

0 comments on commit ea9b3a6

Please sign in to comment.