-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
/***
This file is part of systemd.
#include <gnutls/x509.h>
#endif
+#include "alloc-util.h"
#include "log.h"
#include "macro.h"
+#include "microhttpd-util.h"
#include "string-util.h"
#include "strv.h"
#include "util.h"
-#include "microhttpd-util.h"
void microhttpd_logger(void *arg, const char *fmt, va_list ap) {
char *f;
if (!response)
return MHD_NO;
- log_debug("Queing response %u: %s", code, buffer);
+ log_debug("Queueing response %u: %s", code, buffer);
MHD_add_response_header(response, "Content-Type", "text/plain");
r = MHD_queue_response(connection, code, response);
MHD_destroy_response(response);
}
int mhd_respondf(struct MHD_Connection *connection,
+ int error,
enum MHD_RequestTerminationCode code,
const char *format, ...) {
assert(connection);
assert(format);
+ if (error < 0)
+ error = -error;
+ errno = -error;
va_start(ap, format);
r = vasprintf(&m, format, ap);
va_end(ap);