Commit Graph

11 Commits

Author SHA1 Message Date
Andrew Bettison
bbe7a87904 Add comments and assertions to server.h and server.c 2018-06-01 10:13:01 +09:30
Andrew Bettison
b8ddad6ff2 Move Rhizome function declaration from server.h to rhizome.h and rename 2018-06-01 10:13:01 +09:30
Jeremy Lakeman
d844b0f6bd Reduce coupling with console, dna_helper, monitor & directory_client features 2018-04-03 14:32:06 +09:30
Andrew Bettison
1a091aa8a1 Expose daemon's primary SID in 'proc/primary_sid'
This helps tests distinguish which of a daemon's keyring identities
is used as its primary identity, which is not otherwise obvious
without consulting the routing table, because slots are allocated
in random order.
2018-03-29 15:19:54 +10:30
Jeremy Lakeman
0382e7990e Enable a more graceful shutdown of the server in most cases 2017-09-12 15:37:52 +09:30
Jeremy Lakeman
2540c9e633 Cause rhizome add to poke the daemon and trigger all bundle add notifications 2017-03-06 16:12:55 +10:30
Andrew Bettison
c8bf8a7733 Refactor JNI out of CLI and server main loop
The CLI and server main loop now have no conditional JNI code.  All JNI
code has been moved into separate source files, which #include the new
"jni_common.h" instead of <jni.h>.  The "cli.h" header no longer
includes <jni.h>, so the rest of the Serval source code is now
unaffected by JNI definitions.

The 'cf_limbo' global variable is now thread-local, so that each thread
has its own independent copy of the loaded configuration.  The JNI
server entry point now calls cf_init() once.  The new 'cf_initialised'
flag prevents clobbering the config state by redundant calls to
cf_init().

The CLI "stop" command now sends SIGHUP to the specific thread in which
the server is running.  This is achieved by writing the PID and TID
(Linux Thread ID) into the pidfile, separated by a space, on systems
that support the Linux gettid() and tgkill() system calls.  The server's
signal handler has been overhauled, and its logging improved.
2016-10-13 16:23:18 +10:30
Jeremy Lakeman
51ed6162dd Add support for running and stopping servald from a JVM thread
fdpoll will now run a callback when about to sleep / woke up.
A new Java interface to indicate server started / sleeping / waking up.
An android implementation may allow the CPU to sleep.
If there's a java exception the server will try to shutdown.
Calling servald stop is currently undefined.
2015-05-25 11:46:37 +09:30
Jeremy Lakeman
a37db8e958 Move most console commands to other files 2014-08-25 16:03:30 +09:30
Jeremy Lakeman
52da7778cd Allow closing a monitor connection to force the server to quit 2014-06-11 20:39:26 +09:30
Jeremy Lakeman
b6de3fcd34 Only send rhizome sync packets when we have neighbours 2014-05-30 15:03:22 +09:30