]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/journal-remote/microhttpd-util.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
5 Copyright © 2012 Zbigniew Jędrzejewski-Szmek
8 #include <microhttpd.h>
13 /* Those defines are added when options are renamed. If the old names
14 * are not '#define'd, then they are not deprecated yet and there are
15 * enum elements with the same name. Hence let's check for the *old* name,
16 * and define the new name by the value of the old name. */
18 /* Renamed in µhttpd 0.9.51 */
19 #ifndef MHD_USE_PIPE_FOR_SHUTDOWN
20 # define MHD_USE_ITC MHD_USE_PIPE_FOR_SHUTDOWN
23 /* Renamed in µhttpd 0.9.52 */
24 #ifndef MHD_USE_EPOLL_LINUX_ONLY
25 # define MHD_USE_EPOLL MHD_USE_EPOLL_LINUX_ONLY
28 /* Renamed in µhttpd 0.9.52 */
30 # define MHD_USE_TLS MHD_USE_SSL
33 /* Renamed in µhttpd 0.9.53 */
34 #ifndef MHD_USE_POLL_INTERNALLY
35 # define MHD_USE_POLL_INTERNAL_THREAD MHD_USE_POLL_INTERNALLY
38 /* Both the old and new names are defines, check for the new one. */
40 /* Compatiblity with libmicrohttpd < 0.9.38 */
41 #ifndef MHD_HTTP_NOT_ACCEPTABLE
42 # define MHD_HTTP_NOT_ACCEPTABLE MHD_HTTP_METHOD_NOT_ACCEPTABLE
45 /* Renamed in µhttpd 0.9.53 */
46 #ifndef MHD_HTTP_PAYLOAD_TOO_LARGE
47 # define MHD_HTTP_PAYLOAD_TOO_LARGE MHD_HTTP_REQUEST_ENTITY_TOO_LARGE
50 #if MHD_VERSION < 0x00094203
51 # define MHD_create_response_from_fd_at_offset64 MHD_create_response_from_fd_at_offset
54 void microhttpd_logger(void *arg
, const char *fmt
, va_list ap
) _printf_(2, 0);
56 /* respond_oom() must be usable with return, hence this form. */
57 #define respond_oom(connection) log_oom(), mhd_respond_oom(connection)
59 int mhd_respondf(struct MHD_Connection
*connection
,
62 const char *format
, ...) _printf_(4,5);
64 int mhd_respond(struct MHD_Connection
*connection
,
68 int mhd_respond_oom(struct MHD_Connection
*connection
);
70 int check_permissions(struct MHD_Connection
*connection
, int *code
, char **hostname
);
72 /* Set gnutls internal logging function to a callback which uses our
73 * own logging framework.
75 * gnutls categories are additionally filtered by our internal log
76 * level, so it should be set fairly high to capture all potentially
77 * interesting events without overwhelming detail.
79 int setup_gnutls_logger(char **categories
);