X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=server.c;h=c25786e33bc02fa4478430243182909e40c2b896;hp=b67c7e2962a1cd3eb0d9f0fe6897ebc4d8be975b;hb=34762fdc56d5294c15e03fda433ecfccdc6c5fb2;hpb=dc4030458f9af07d5719cfbff0a47cd16f1847f7 diff --git a/server.c b/server.c index b67c7e29..c25786e3 100644 --- a/server.c +++ b/server.c @@ -30,7 +30,7 @@ #include "server.cmdline.h" -#include "db.h" +#include "afs.h" #include "server.h" #include "vss.h" #include "config.h" @@ -51,15 +51,23 @@ INIT_SERVER_ERRLISTS; /** shut down non-authorized connections after that many seconds */ #define ALARM_TIMEOUT 10 -/* these are exported to vss.c. command.c and to all selectors */ +/** + * pointer to shared memory area for communication between para_server + * and its children. exported to vss.c. command.c and to all selectors. + */ struct misc_meta_data *mmd; -/** the configuration of para_server + +/** + * the configuration of para_server * - * It also contains the options for all audio file selectors and all supported - * senders. -*/ + * It also contains the options for all audio file selectors, audio format handler + * and all supported senders. + */ struct server_args_info conf; + +/** the file containing user information (public key, permissions) */ char *user_list_file = NULL; + extern void dccp_send_init(struct sender *); extern void http_send_init(struct sender *); extern void ortp_send_init(struct sender *); @@ -320,8 +328,9 @@ err: static void init_random_seed(void) { - int fd, ret = -1, len = sizeof(unsigned int); + int fd, ret = -1; unsigned int seed; + size_t len = sizeof(unsigned int); fd = open("/dev/urandom", O_RDONLY); if (fd < 0) @@ -349,6 +358,7 @@ static unsigned do_inits(int argc, char **argv) init_random_seed(); /* parse command line options */ server_cmdline_parser(argc, argv, &conf); + HANDLE_VERSION_FLAG("server", conf); para_drop_privileges(conf.user_arg, conf.group_arg); /* parse config file, open log and set defaults */ parse_config(0); @@ -360,8 +370,8 @@ static unsigned do_inits(int argc, char **argv) if (conf.daemon_given) daemon_init(); init_selector(); - PARA_NOTICE_LOG("%s", "initializing audio file sender\n"); - /* audio file sender */ +// PARA_ERROR_LOG("num: %d\n", mmd->selector_num); + PARA_NOTICE_LOG("%s", "initializing virtual streaming system\n"); vss_init(); mmd->server_pid = getpid(); setup_signal_handling(); @@ -427,8 +437,14 @@ out: } } -/* - * MAIN +/** + * the main function of para_server + * + * \param argc usual argument count + * \param argv usual argument vector + * + * \return EXIT_SUCCESS or EXIT_FAILURE + * */ int main(int argc, char *argv[]) {