diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2024-08-20 00:07:05 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2024-08-22 02:27:34 +0200 |
| commit | 43e89fb23943b5ffb6854f290592c29cd079bf46 (patch) | |
| tree | 3a295c16aebdcbea5ce733fe61ba8ba639bc4f41 /include | |
| parent | 34b62bd0c47c915a12ff1b81f52b123fc3eb4a69 (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 'include')
| -rw-r--r-- | include/libweb/handler.h | 1 | ||||
| -rw-r--r-- | include/libweb/server.h | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/include/libweb/handler.h b/include/libweb/handler.h index 72ef1e0..7e0b601 100644 --- a/include/libweb/handler.h +++ b/include/libweb/handler.h @@ -24,5 +24,6 @@ int handler_add(struct handler *h, const char *url, enum http_op op, int handler_listen(struct handler *h, unsigned short port, unsigned short *outport); int handler_loop(struct handler *h); +int handler_notify_close(struct handler *h); #endif /* HANDLER_H */ diff --git a/include/libweb/server.h b/include/libweb/server.h index b3691aa..08e0f34 100644 --- a/include/libweb/server.h +++ b/include/libweb/server.h @@ -11,5 +11,6 @@ int server_write(const void *buf, size_t n, struct server_client *c); int server_close(struct server *s); int server_client_close(struct server *s, struct server_client *c); void server_client_write_pending(struct server_client *c, bool write); +int server_notify_close(struct server *s); #endif /* SERVER_H */ |
