summaryrefslogtreecommitdiff
path: root/ecp/server/server.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2024-05-07 22:19:24 +0200
committerUros Majstorovic <majstor@majstor.org>2024-05-07 22:19:24 +0200
commitada578323291eb51cc9524b4e07963e330b54c1d (patch)
tree7d650cabad9078babd74c54a6d05ecee52e0dbe5 /ecp/server/server.c
parent9b5e1d985643f209f322254615039c09510f74f7 (diff)
reload acl list on SIGUSR1
Diffstat (limited to 'ecp/server/server.c')
-rw-r--r--ecp/server/server.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/ecp/server/server.c b/ecp/server/server.c
index 890d468..a4bd8f6 100644
--- a/ecp/server/server.c
+++ b/ecp/server/server.c
@@ -16,6 +16,7 @@
#include "vlink.h"
#include "ht.h"
#include "acl.h"
+#include "sig.h"
#include "server.h"
@@ -97,6 +98,10 @@ static ECPConnection *conn_new(ECPSocket *sock, ECPConnection *parent, unsigned
return conn;
}
+static void conn_free(ECPConnection *conn) {
+ free(conn);
+}
+
static int key_check(ECPSocket *sock, ECPConnection *parent, unsigned char ctype, ecp_ecdh_public_t *public) {
switch (ctype) {
case CTYPE_DIR: {
@@ -115,10 +120,6 @@ static int key_check(ECPSocket *sock, ECPConnection *parent, unsigned char ctype
}
}
-static void conn_free(ECPConnection *conn) {
- free(conn);
-}
-
void log_print(int level, char *format, ...) {
va_list args;
time_t t;
@@ -221,6 +222,9 @@ int main(int argc, char *argv[]) {
if (rv) fail("acl_load err:%d\n", rv);
}
+ rv = sig_init();
+ if (rv) fail("sig_init err:%d\n", rv);
+
rv = dir_init(&sock);
if (rv) fail("dir_init err:%d\n", rv);
@@ -230,6 +234,9 @@ int main(int argc, char *argv[]) {
rv = ecp_start_receiver(&sock);
if (rv) fail("ecp_start_receiver err:%d\n", rv);
+ rv = sig_start_handler();
+ if (rv) fail("sig_start_handler err:%d\n", rv);
+
if (argc == _argc + 2) {
ECPNode node;
ecp_ecdh_public_t node_pub;