aboutsummaryrefslogtreecommitdiff
path: root/handler.c
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2024-08-20 00:07:05 +0200
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2024-08-22 02:27:34 +0200
commit43e89fb23943b5ffb6854f290592c29cd079bf46 (patch)
tree3a295c16aebdcbea5ce733fe61ba8ba639bc4f41 /handler.c
parent34b62bd0c47c915a12ff1b81f52b123fc3eb4a69 (diff)
Move signal handling to processes
So far, libweb installed a signal handler so as to handle SIGTERM, SIGPIPE and SIGINT signals so that processes would not have to care about such details. However, it is not advisable for libraries to install signal handlers, as signals are handled on a per-process basis. The previous approach would be incompatible if several instances of the library were allocated by the same process. Unfortunately, this has the undesired side effect of adding the boilerplate code into the process.
Diffstat (limited to 'handler.c')
-rw-r--r--handler.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/handler.c b/handler.c
index 3d806e6..b8ecb52 100644
--- a/handler.c
+++ b/handler.c
@@ -180,6 +180,11 @@ static int remove_client_from_list(struct handler *const h,
return ret;
}
+int handler_notify_close(struct handler *const h)
+{
+ return server_notify_close(h->server);
+}
+
int handler_listen(struct handler *const h, const unsigned short port,
unsigned short *const outport)
{