ortp_recv: Set remote address
[paraslash.git] / server.c
index 6f70d97..ce56494 100644 (file)
--- a/server.c
+++ b/server.c
@@ -56,12 +56,11 @@ struct misc_meta_data *mmd;
  * It also contains the options for all audio file selectors and all supported
  * senders.
 */
-struct gengetopt_args_info conf;
+struct server_args_info conf;
 char *user_list = NULL;
 extern void dccp_send_init(struct sender *);
 extern void http_send_init(struct sender *);
 extern void ortp_send_init(struct sender *);
-extern struct audio_format afl[];
 
 /* TODO: This is better handled by autoconf */
 /** the list of supported audio file selectors */
@@ -235,7 +234,7 @@ static void parse_config(int override)
        }
        if (!ret) {
                int tmp = conf.daemon_given;
-               cmdline_parser_configfile(cf, &conf, override, 0, 0);
+               server_cmdline_parser_configfile(cf, &conf, override, 0, 0);
                conf.daemon_given = tmp;
        }
        /* logfile */
@@ -340,7 +339,7 @@ static unsigned do_inits(int argc, char **argv)
 
        init_random_seed();
        /* parse command line options */
-       cmdline_parser(argc, argv, &conf);
+       server_cmdline_parser(argc, argv, &conf);
        para_drop_privileges(conf.user_arg, conf.group_arg);
        /* parse config file, open log and set defaults */
        parse_config(0);
@@ -450,10 +449,7 @@ repeat:
                        continue;
                if (!senders[i].pre_select)
                        continue;
-               senders[i].pre_select(mmd->audio_format >= 0?
-                       &afl[mmd->audio_format] : NULL,
-                       &max_fileno,
-                       &rfds, &wfds);
+               senders[i].pre_select( &max_fileno, &rfds, &wfds);
        }
        if (selectors[mmd->selector_num].pre_select) {
                ret = selectors[mmd->selector_num].pre_select(&rfds, &wfds);
@@ -473,14 +469,10 @@ repeat:
                        continue;
                if (!senders[i].post_select)
                        continue;
-               senders[i].post_select(mmd->audio_format >= 0?
-                       &afl[mmd->audio_format] : NULL,
-                       &rfds, &wfds);
-       }
-       if (!ret) {
-               afs_send_chunk();
-               status_refresh();
+               senders[i].post_select(&rfds, &wfds);
        }
+       afs_send_chunk();
+       status_refresh();
        if (FD_ISSET(signal_pipe, &rfds)) {
                int sig;
                sig = para_next_signal();