$(DOVECOT_SSL_LIBS) \
$(LIBDOVECOT_DEPS)
+stats_services =
+
stats_SOURCES = \
main.c
event-exporter-transport-drop.c \
event-exporter-transport-http-post.c \
event-exporter-transport-log.c \
+ $(stats_services) \
+ stats-service.c \
stats-event-category.c \
stats-metrics.c \
stats-settings.c
client-writer.h \
client-http.h\
event-exporter.h \
+ stats-service.h \
+ stats-service-private.h \
stats-event-category.h \
stats-metrics.h \
stats-settings.h \
#include "http-server.h"
#include "http-url.h"
#include "stats-metrics.h"
+#include "stats-service.h"
#include "client-http.h"
struct stats_http_client;
if (strcmp(hreq->method, "OPTIONS") == 0) {
resp = http_server_response_create(req, 200, "OK");
+ http_server_response_add_header(resp, "Allow", "GET");
http_server_response_submit(resp);
return;
}
if (strcmp(hreq->method, "GET") != 0) {
- http_server_request_fail(req, 405, "Method Not Allowed");
+ http_server_request_fail_bad_method(req, "GET");
return;
}
if (*sub_path != '\0') {
#include "stats-settings.h"
#include "stats-event-category.h"
#include "stats-metrics.h"
+#include "stats-service.h"
#include "client-writer.h"
#include "client-reader.h"
#include "client-http.h"
client_readers_init();
client_writers_init();
client_http_init();
+ stats_services_init();
}
static void main_deinit(void)
{
+ stats_services_deinit();
client_readers_deinit();
client_writers_deinit();
client_http_deinit();
--- /dev/null
+#ifndef STATS_SERVICE_PRIVATE_H
+#define STATS_SERVICE_PRIVATE_H
+
+#include "stats-service.h"
+
+#endif
--- /dev/null
+/* Copyright (c) 2019 Dovecot authors, see the included COPYING file */
+
+#include "stats-common.h"
+#include "http-server.h"
+#include "stats-service-private.h"
+
+void stats_services_init(void)
+{
+ /* Nothing yet */
+}
+
+void stats_services_deinit(void)
+{
+ /* Nothing yet */
+}
--- /dev/null
+#ifndef STATS_SERVICE_H
+#define STATS_SERVICE_H
+
+void stats_services_init(void);
+void stats_services_deinit(void);
+
+#endif