Fix ogg streaming.
[paraslash.git] / server.c
index d8fc48eeb0f7b220e49832ccb9e1e5706c63fde0..febfe2ad02ca2828c1dffe65d2243ed8b661e605 100644 (file)
--- a/server.c
+++ b/server.c
@@ -23,8 +23,8 @@
  *
  * The gory details, listed by topic:
  *
- *     - Audio format handlers: \ref mp3_afh.c, \ref ogg_afh.c \ref aac_afh.c,
- *     - Decoders: \ref mp3dec.c, \ref \ref oggdec.c, \ref aacdec.c,
+ *     - Audio format handlers: \ref mp3_afh.c, \ref ogg_afh.c, \ref aac_afh.c,
+ *     - Decoders: \ref mp3dec.c, \ref oggdec.c, \ref aacdec.c,
  *     - Volume normalizer: \ref compress.c,
  *     - Output: \ref alsa_write.c, \ref osx_write.c,
  *     - http: \ref http_recv.c, \ref http_send.c,
@@ -32,7 +32,7 @@
  *     - dccp: \ref dccp_recv.c, \ref dccp_send.c,
  *     - Audio file selector: \ref afs.c, \ref aft.c, \ref mood.c,
  *     - Afs structures: \ref afs_table, \ref audio_file_data,
- *       \ref afs_info \ref audio_format_info,
+ *       \ref afs_info \ref afh_info,
  *     - Afs tables: \ref aft.c, \ref mood.c, \ref playlist.c,
  *       \ref attribute.c, \ref score.c,
  *     - The virtual streaming system: \ref vss.c, \ref chunk_queue.c.
@@ -287,7 +287,8 @@ static void setup_signal_handling(void)
        int ret = 0;
 
        signal_pipe = para_signal_init();
-       PARA_NOTICE_LOG("%s", "setting up signal handlers\n");
+
+       PARA_NOTICE_LOG("setting up signal handlers\n");
        ret += para_install_sighandler(SIGINT);
        ret += para_install_sighandler(SIGTERM);
        ret += para_install_sighandler(SIGHUP);
@@ -298,6 +299,7 @@ static void setup_signal_handling(void)
                PARA_EMERG_LOG("%s", "could not install signal handlers\n");
                exit(EXIT_FAILURE);
        }
+       add_close_on_fork_list(signal_pipe);
 }
 
 static unsigned init_network(void)
@@ -310,6 +312,7 @@ static unsigned init_network(void)
        ret = mark_fd_nonblock(fd);
        if (ret < 0)
                goto err;
+       add_close_on_fork_list(fd); /* child doesn't need the listener */
        return fd;
 err:
        PARA_EMERG_LOG("%s\n", PARA_STRERROR(-ret));
@@ -557,7 +560,7 @@ genocide:
        }
        alarm(ALARM_TIMEOUT);
        close_listed_fds();
-       close(sockfd); /* child doesn't need the listener */
+       para_signal_shutdown();
        /*
         * put info on who we are serving into argv[0] to make
         * client ip visible in top/ps