chiark / gitweb /
microhttp-util: rework gnutls logging
[elogind.git] / src / journal / microhttpd-util.h
index d4fefa72d3b26465fbd359012683818518a2d318..4186da888e12fa083bf78343f0aaa19dcd484743 100644 (file)
 #pragma once
 
 #include <stdarg.h>
+#include <microhttpd.h>
 
-void microhttpd_logger(void *arg, const char *fmt, va_list ap);
+#include "macro.h"
+
+void microhttpd_logger(void *arg, const char *fmt, va_list ap) _printf_(2, 0);
+
+/* respond_oom() must be usable with return, hence this form. */
+#define respond_oom(connection) log_oom(), mhd_respond_oom(connection)
+
+int mhd_respondf(struct MHD_Connection *connection,
+                 unsigned code,
+                 const char *format, ...) _printf_(3,4);
+
+int mhd_respond(struct MHD_Connection *connection,
+                unsigned code,
+                const char *message);
+
+int mhd_respond_oom(struct MHD_Connection *connection);
+
+int check_permissions(struct MHD_Connection *connection, int *code);
+
+#ifdef HAVE_GNUTLS
+void log_func_gnutls(int level, const char *message);
+int log_enable_gnutls_category(const char *cat);
+void log_reset_gnutls_level(void);
+
+/* This is additionally filtered by our internal log level, so it
+ * should be set fairly high to capture all potentially interesting
+ * events without overwhelming detail.
+ */
+#endif