X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=server.c;h=15ae5c9a296be654471fd1f95aa9395629fae097;hp=efff208b1bd704a1e5bf64aee32491b514b5b14e;hb=b307a25ed895caa33684302b502e9e0e70dc78b7;hpb=db1a8e68e58a03bcf06ccc91e78c4da94e7b9144 diff --git a/server.c b/server.c index efff208b..15ae5c9a 100644 --- a/server.c +++ b/server.c @@ -52,20 +52,19 @@ * - Blob tables: \ref blob.c, * - The error subssystem: \ref error.h. * - Access control for paraslash senders: \ref acl.c, \ref acl.h. + * - Internal crypto API: \ref crypt.h. * * Low-level data structures: * * - Doubly linked lists: \ref list.h, * - Ring buffer: \ref ringbuffer.c, \ref ringbuffer.h, - * - Hashing: \ref hash.h, \ref sha1.h, \ref sha1.c, - * - Crypto: \ref crypt.c. + * - openssl: \ref crypt.c + * - libgcrypt: \ref gcrypt.c * - Forward error correction: \ref fec.c. */ #include -#include #include -#include #include #include #include @@ -91,6 +90,7 @@ #include "signal.h" #include "user_list.h" #include "color.h" +#include "version.h" /** Define the array of error lists needed by para_server. */ INIT_SERVER_ERRLISTS; @@ -147,17 +147,14 @@ static int want_colors(void) static void init_colors_or_die(void) { - int ret, i; + int i; if (!want_colors()) return; daemon_set_flag(DF_COLOR_LOG); daemon_set_default_log_colors(); - for (i = 0; i < conf.log_color_given; i++) { - ret = daemon_set_log_color(conf.log_color_arg[i]); - if (ret < 0) - exit(EXIT_FAILURE); - } + for (i = 0; i < conf.log_color_given; i++) + daemon_set_log_color_or_die(conf.log_color_arg[i]); } /* @@ -429,6 +426,7 @@ static void init_server_command_task(int argc, char **argv) if (ret < 0) goto err; add_close_on_fork_list(sct->listen_fd); /* child doesn't need the listener */ + sprintf(sct->task.status, "server command task"); register_task(&sct->task); return; err: @@ -493,7 +491,7 @@ static void server_init(int argc, char **argv) init_ipc_or_die(); /* init mmd struct and mmd->lock */ /* make sure, the global now pointer is uptodate */ gettimeofday(now, NULL); - server_uptime(UPTIME_SET); /* reset server uptime */ + set_server_start_time(now); init_user_list(user_list_file); /* become daemon */ if (conf.daemon_given) @@ -527,7 +525,7 @@ static void server_init(int argc, char **argv) static void status_refresh(void) { static int prev_uptime = -1, prev_events = -1; - int uptime = server_uptime(UPTIME_GET), ret = 1; + int uptime = get_server_uptime(now); if (prev_events != mmd->events) goto out; @@ -542,11 +540,8 @@ out: prev_uptime = uptime; prev_events = mmd->events; mmd->vss_status_flags = mmd->new_vss_status_flags; - if (ret) { - PARA_DEBUG_LOG("%d events, forcing status update\n", - mmd->events); - killpg(0, SIGUSR1); - } + PARA_DEBUG_LOG("%d events, forcing status update\n", mmd->events); + killpg(0, SIGUSR1); } static int server_select(int max_fileno, fd_set *readfds, fd_set *writefds,