mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 12:15:12 +00:00
[MOD] Clarify a bit of licensing
This commit is contained in:
parent
ffc0679493
commit
ccecc2d435
3 changed files with 26 additions and 49 deletions
8
LICENSE
8
LICENSE
|
|
@ -1,8 +1,8 @@
|
||||||
For the files src/XML/*, tools/*, src/include/XML.h, and Makefile, see COPYING.CC0
|
For the files src/XML/*, tools/*, src/include/XML.h, etc/*, and Makefile, see COPYING.CC0
|
||||||
For the file src/Signal.c, it is based on Telodendria, which requires COPYING.TELO
|
|
||||||
to be present.
|
to be present.
|
||||||
For any other file in src/, see COPYING.AGPL as the primary license.
|
For any other file in src/, see COPYING.AGPL as the primary license.
|
||||||
|
|
||||||
|
As Parsee depends on Cytoplasm, its license is left here in COPYING.CYTO
|
||||||
|
|
||||||
COPYING.CC0 and COPYING.TELO are NOT the primary licenses. COPYING.TELO is present
|
COPYING.CC0 and COPYING.TELO are NOT the primary licenses. COPYING.TELO is present
|
||||||
because of the terms of the Telodendria license, which some of its code is derived
|
because of the terms of the Telodendria licence, used by Cytoplasm, and COPYING.CC0 ONLY applies to the XML parser code.
|
||||||
in src/Signal.c, and COPYING.CC0 ONLY applies to the XML parser code.
|
|
||||||
|
|
|
||||||
47
src/Signal.c
47
src/Signal.c
|
|
@ -8,21 +8,13 @@
|
||||||
|
|
||||||
static HttpServer *server = NULL;
|
static HttpServer *server = NULL;
|
||||||
static pthread_t xmpp_thr;
|
static pthread_t xmpp_thr;
|
||||||
static bool valid = true;
|
|
||||||
static XMPPComponent *jabber = NULL;
|
static XMPPComponent *jabber = NULL;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
SignalHandler(int signal)
|
SignalHandler(int signal)
|
||||||
{
|
{
|
||||||
switch (signal)
|
if (server && (signal == SIGTERM || signal == SIGINT))
|
||||||
{
|
{
|
||||||
case SIGPIPE:
|
|
||||||
return;
|
|
||||||
case SIGUSR1:
|
|
||||||
/* TODO: Soft-restart everything */
|
|
||||||
return;
|
|
||||||
case SIGTERM:
|
|
||||||
case SIGINT:
|
|
||||||
if (!server)
|
if (!server)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|
@ -32,45 +24,30 @@ SignalHandler(int signal)
|
||||||
Log(LOG_INFO, "Killing thread...");
|
Log(LOG_INFO, "Killing thread...");
|
||||||
XMPPFinishCompStream(jabber);
|
XMPPFinishCompStream(jabber);
|
||||||
pthread_join(xmpp_thr, NULL);
|
pthread_join(xmpp_thr, NULL);
|
||||||
valid = false;
|
|
||||||
Log(LOG_INFO, "Stopping server...");
|
Log(LOG_INFO, "Stopping server...");
|
||||||
HttpServerStop(server);
|
HttpServerStop(server);
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ParseeInitialiseSignals(HttpServer *s, pthread_t xmpp, XMPPComponent *j)
|
ParseeInitialiseSignals(HttpServer *s, pthread_t xmpp, XMPPComponent *j)
|
||||||
{
|
{
|
||||||
struct sigaction sigAction;
|
struct sigaction sa;
|
||||||
bool ret = true;
|
|
||||||
|
|
||||||
server = s;
|
server = s;
|
||||||
xmpp_thr = xmpp;
|
xmpp_thr = xmpp;
|
||||||
jabber = j;
|
jabber = j;
|
||||||
|
|
||||||
valid = true;
|
sigfillset(&sa.sa_mask);
|
||||||
|
sa.sa_handler = SignalHandler;
|
||||||
|
sa.sa_flags = SA_RESTART;
|
||||||
|
|
||||||
sigAction.sa_handler = SignalHandler;
|
#define Register(act) (sigaction(act, &sa, NULL) >= 0)
|
||||||
sigfillset(&sigAction.sa_mask);
|
if (!Register(SIGTERM) || !Register(SIGINT))
|
||||||
sigAction.sa_flags = SA_RESTART;
|
{
|
||||||
|
return false;
|
||||||
#define SIGACTION(sig, act, oact) \
|
|
||||||
if (sigaction(sig, act, oact) < 0) \
|
|
||||||
{ \
|
|
||||||
Log(LOG_ERR, "Unable to install signal handler: %s", #sig); \
|
|
||||||
ret = false; \
|
|
||||||
} \
|
|
||||||
else \
|
|
||||||
{ \
|
|
||||||
Log(LOG_DEBUG, "Installed signal handler: %s", #sig); \
|
|
||||||
}
|
}
|
||||||
|
#undef Register
|
||||||
SIGACTION(SIGINT, &sigAction, NULL);
|
return true;
|
||||||
SIGACTION(SIGTERM, &sigAction, NULL);
|
|
||||||
SIGACTION(SIGPIPE, &sigAction, NULL);
|
|
||||||
SIGACTION(SIGUSR1, &sigAction, NULL); /* Make USR1 do a softrestart */
|
|
||||||
#undef SIGACTION
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue