X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=server.c;h=af93941dd6dba2a56fc2cb63d23162f9355c46fb;hp=ca71c4d8860e49224ffd0f2203ed76a7253a1a01;hb=5924e7281692044588e6df713c5d6c694ddd69f1;hpb=7bf76e7907de7836f75c299dc2e828364e4f114e diff --git a/server.c b/server.c index ca71c4d8..af93941d 100644 --- a/server.c +++ b/server.c @@ -18,7 +18,7 @@ * - Buffer trees: \ref buffer_tree.h, * - Sideband API: \ref sideband.h, * - Crypto: \ref crypt.h, \ref crypt_backend.h, - * - Error subsystem: \ref error.h, \ref error2.c, + * - Error subsystem: \ref error.h, * - Inter process communication: \ref ipc.h, * - Forward error correction: \ref fec.h, * - Daemons: \ref daemon.h, @@ -65,10 +65,10 @@ #include "ggo.h" #include "version.h" -__printf_2_3 void (*para_log)(int, const char*, ...) = daemon_log; +/** Array of error strings. */ +DEFINE_PARA_ERRLIST; -/** Define the array of error lists needed by para_server. */ -INIT_SERVER_ERRLISTS; +__printf_2_3 void (*para_log)(int, const char*, ...) = daemon_log; /** Shut down non-authorized connections after that many seconds. */ #define ALARM_TIMEOUT 10 @@ -331,8 +331,6 @@ static int command_post_select(struct sched *s, void *context) ret = para_accept(sct->listen_fd, &s->rfds, NULL, 0, &new_fd); if (ret <= 0) goto out; - peer_name = remote_name(new_fd); - PARA_INFO_LOG("got connection from %s, forking\n", peer_name); mmd->num_connects++; mmd->active_connections++; /* @@ -358,6 +356,8 @@ static int command_post_select(struct sched *s, void *context) /* parent keeps accepting connections */ return 0; } + peer_name = remote_name(new_fd); + PARA_INFO_LOG("accepted connection from %s\n", peer_name); /* mmd might already have changed at this point */ free(chunk_table); alarm(ALARM_TIMEOUT); @@ -537,7 +537,7 @@ out: prev_uptime = uptime; prev_events = mmd->events; mmd->vss_status_flags = mmd->new_vss_status_flags; - PARA_DEBUG_LOG("%d events, forcing status update\n", mmd->events); + PARA_DEBUG_LOG("%u events, forcing status update\n", mmd->events); killpg(0, SIGUSR1); }