]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge branch 't/sched_cleanups'
authorAndre Noll <maan@systemlinux.org>
Sun, 17 Oct 2010 11:04:55 +0000 (13:04 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 17 Oct 2010 11:04:55 +0000 (13:04 +0200)
NEWS
audiod.c
buffer_tree.c
buffer_tree.h
dccp_send.c
mood.c
net.c
para.h
recv.h
udp_recv.c
web/download.in.html

diff --git a/NEWS b/NEWS
index cb7ba06d5ae70631f6160daf5f9a8888a3227526..17cd87a910009a40fdec479bc9a6dbf871c6faa0 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,7 +2,11 @@
 0.4.5 (to be announced) "symmetric randomization"
 -------------------------------------------------
 
-       - Fix an invalid-free-bug in the ogg audio format handler code.
+       - Contains a fix for an invalid-free-bug in the ogg audio format
+         handler code.
+       - Improved documentation and error diagnostics.
+       - Switching off the DCCP sender works again.
+       - para_audiod handles crashes of para_server more robustly.
 
 ------------------------------------------
 0.4.4 (2010-08-06) "persistent regularity"
index 668b0f744cf316d3c1b8ad916845831f3c88b2d0..89b160db527ae9397a2bd2b216b304d6c4c8920f 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -1222,6 +1222,8 @@ static void status_post_select(__a_unused struct sched *s, struct task *t)
                        st->min_iqs = sz + 1;
                goto out;
        }
+       btr_drain(st->btrn);
+       st->current_audio_format_num = -1;
        if (tv_diff(now, &st->restart_barrier, NULL) < 0)
                goto out;
        if (st->clock_diff_count) { /* get status only one time */
index d92d9863e10e2b4081fba91a35b06233933a15cc..bdcbec8de73c0348ea0a0e223e38b3584bee488a 100644 (file)
@@ -660,9 +660,10 @@ void btr_consume(struct btr_node *btrn, size_t numbytes)
        return btr_consume(btrn, sz);
 }
 
-static void flush_input_queue(struct btr_node *btrn)
+void btr_drain(struct btr_node *btrn)
 {
        struct btr_buffer_reference *br, *tmp;
+
        FOR_EACH_BUFFER_REF_SAFE(br, tmp, btrn)
                btr_drop_buffer_reference(br);
 }
@@ -670,6 +671,8 @@ static void flush_input_queue(struct btr_node *btrn)
 /**
  * Free all resources allocated by btr_new_node().
  *
+ * \param btrn Pointer to a btr node obtained by \ref btr_new_node().
+ *
  * Like free(3), it is OK to call this with a \p NULL pointer argument.
  */
 void btr_free_node(struct btr_node *btrn)
@@ -700,7 +703,7 @@ void btr_remove_node(struct btr_node *btrn)
        PARA_NOTICE_LOG("removing btr node %s from buffer tree\n", btrn->name);
        FOR_EACH_CHILD(ch, btrn)
                ch->parent = NULL;
-       flush_input_queue(btrn);
+       btr_drain(btrn);
        if (btrn->parent)
                list_del(&btrn->node);
 }
index 549f95a224e1ede3ec8e5344d8beb87f3fb88e31..8bc8e6029c841482bdfb8c5a01e0c4fc1d2b404e 100644 (file)
@@ -202,3 +202,4 @@ int btr_node_status(struct btr_node *btrn, size_t min_iqs,
                enum btr_node_type type);
 void btr_get_node_start(struct btr_node *btrn, struct timeval *tv);
 struct btr_node *btr_search_node(const char *name, struct btr_node *root);
+void btr_drain(struct btr_node *btrn);
index 41aaf234da6ce89da2e25ce30871405f663cac38..a2ee0270733a3d47b2053173b9e74bbdbfb4eeff 100644 (file)
@@ -155,6 +155,7 @@ static int dccp_com_on(__a_unused struct sender_command_data *scd)
 
 static int dccp_com_off(__a_unused struct sender_command_data *scd)
 {
+       dccp_shutdown_clients();
        generic_com_off(dss);
        return 1;
 }
diff --git a/mood.c b/mood.c
index d24eac912161f5d51c27ea020c08fccddb2f066a..89ad80d956af3b7107f7ae4883619e689d3d2582 100644 (file)
--- a/mood.c
+++ b/mood.c
@@ -890,6 +890,17 @@ static int reload_current_mood(void)
        return ret;
 }
 
+/**
+ * Notification callback for the moods table.
+ *
+ * \param event Type of the event just occurred.
+ * \param pb Unused.
+ * \param data Its type depends on the event.
+ *
+ * This function performs actions required due to the occurrence of the given
+ * event. Possible actions include reload of the current mood and update of the
+ * score of an audio file.
+ */
 int moods_event_handler(enum afs_events event, __a_unused struct para_buffer *pb,
                void *data)
 {
@@ -926,4 +937,3 @@ int moods_event_handler(enum afs_events event, __a_unused struct para_buffer *pb
                return 1;
        }
 }
-
diff --git a/net.c b/net.c
index 32f3ffe943d33d7ffca4f002e2d2c1c4a52841da..64602a4bf60e7ce934f230cb0ae9d63f5ec404f5 100644 (file)
--- a/net.c
+++ b/net.c
@@ -951,7 +951,7 @@ int connect_local_socket(const char *name)
        struct sockaddr_un unix_addr;
        int fd, ret;
 
-       PARA_INFO_LOG("connecting to %s\n", name);
+       PARA_DEBUG_LOG("connecting to %s\n", name);
        ret = init_unix_addr(&unix_addr, name);
        if (ret < 0)
                return ret;
diff --git a/para.h b/para.h
index 287e3c7a905bddd73b0cfda92e2653292ff93ab8..afb638213e0819a5188f2365a82cc29dcd76fe18 100644 (file)
--- a/para.h
+++ b/para.h
        typeof(x) _x = (x); \
        _x > 0? _x : -_x; })
 
-/** Debug loglevel, gets really noisy. */
-#define LL_DEBUG 0
-/** Still noisy, but won't fill your disk. */
-#define LL_INFO  1
-/** Normal, but significant event. */
-#define LL_NOTICE 2
-/** Unexpected event that can be handled. */
-#define LL_WARNING 3
-/** Unhandled error condition. */
-#define LL_ERROR 4
-/** System might be unreliable. */
-#define LL_CRIT 5
-/** Last message before exit. */
-#define LL_EMERG 6
-/** Number of all loglevels. */
-#define NUM_LOGLEVELS 7
-
-/** Log messages with lower priority than that will not be compiled in. */
-#define COMPILE_TIME_LOGLEVEL 0
-
-/** \cond */
-#if LL_DEBUG >= COMPILE_TIME_LOGLEVEL
-#define PARA_DEBUG_LOG(f,...) para_log(LL_DEBUG, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
-#else
-#define PARA_DEBUG_LOG(...) do {;} while (0)
-#endif
-
-#if LL_INFO >= COMPILE_TIME_LOGLEVEL
-#define PARA_INFO_LOG(f,...) para_log(LL_INFO, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
-#else
-#define PARA_INFO_LOG(...) do {;} while (0)
-#endif
-
-#if LL_NOTICE >= COMPILE_TIME_LOGLEVEL
-#define PARA_NOTICE_LOG(f,...) para_log(LL_NOTICE, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
-#else
-#define PARA_NOTICE_LOG(...) do {;} while (0)
-#endif
-
-#if LL_WARNING >= COMPILE_TIME_LOGLEVEL
-#define PARA_WARNING_LOG(f,...) para_log(LL_WARNING, "%s: " f, __FUNCTION__, ##  __VA_ARGS__)
-#else
-#define PARA_WARNING_LOG(...) do {;} while (0)
-#endif
-
-#if LL_ERROR >= COMPILE_TIME_LOGLEVEL
-#define PARA_ERROR_LOG(f,...) para_log(LL_ERROR, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
-#else
-#define PARA_ERROR_LOG(...) do {;} while (0)
-#endif
-
-#if LL_CRIT >= COMPILE_TIME_LOGLEVEL
-#define PARA_CRIT_LOG(f,...) para_log(LL_CRIT, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
-#else
-#define PARA_CRIT_LOG(...) do {;} while (0)
-#endif
-
-#if LL_EMERG >= COMPILE_TIME_LOGLEVEL
-#define PARA_EMERG_LOG(f,...) para_log(LL_EMERG, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
-#else
-#define PARA_EMERG_LOG(...)
-#endif
-/** \endcond */
-
 /**
  * define a standard log function that always writes to stderr
  *
@@ -265,7 +201,7 @@ _static_inline_ long int para_random(unsigned max)
  * It may be determined by one of the following sources:
  *
  *     1. The decoding filter (para_audiod only). In this case, it is always
- *     \t SF_S16_LE which is the canonical format used within decoders.
+ *     \p SF_S16_LE which is the canonical format used within decoders.
  *
  *     2. The wav header (para_write only).
  *
@@ -283,3 +219,67 @@ _static_inline_ long int para_random(unsigned max)
 enum sample_format {SAMPLE_FORMATS};
 #undef SAMPLE_FORMAT
 #define SAMPLE_FORMAT(a, b) b
+
+/** Debug loglevel, gets really noisy. */
+#define LL_DEBUG 0
+/** Still noisy, but won't fill your disk. */
+#define LL_INFO  1
+/** Normal, but significant event. */
+#define LL_NOTICE 2
+/** Unexpected event that can be handled. */
+#define LL_WARNING 3
+/** Unhandled error condition. */
+#define LL_ERROR 4
+/** System might be unreliable. */
+#define LL_CRIT 5
+/** Last message before exit. */
+#define LL_EMERG 6
+/** Number of all loglevels. */
+#define NUM_LOGLEVELS 7
+
+/** Log messages with lower priority than that will not be compiled in. */
+#define COMPILE_TIME_LOGLEVEL 0
+
+/** \cond */
+#if LL_DEBUG >= COMPILE_TIME_LOGLEVEL
+#define PARA_DEBUG_LOG(f,...) para_log(LL_DEBUG, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
+#else
+#define PARA_DEBUG_LOG(...) do {;} while (0)
+#endif
+
+#if LL_INFO >= COMPILE_TIME_LOGLEVEL
+#define PARA_INFO_LOG(f,...) para_log(LL_INFO, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
+#else
+#define PARA_INFO_LOG(...) do {;} while (0)
+#endif
+
+#if LL_NOTICE >= COMPILE_TIME_LOGLEVEL
+#define PARA_NOTICE_LOG(f,...) para_log(LL_NOTICE, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
+#else
+#define PARA_NOTICE_LOG(...) do {;} while (0)
+#endif
+
+#if LL_WARNING >= COMPILE_TIME_LOGLEVEL
+#define PARA_WARNING_LOG(f,...) para_log(LL_WARNING, "%s: " f, __FUNCTION__, ##  __VA_ARGS__)
+#else
+#define PARA_WARNING_LOG(...) do {;} while (0)
+#endif
+
+#if LL_ERROR >= COMPILE_TIME_LOGLEVEL
+#define PARA_ERROR_LOG(f,...) para_log(LL_ERROR, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
+#else
+#define PARA_ERROR_LOG(...) do {;} while (0)
+#endif
+
+#if LL_CRIT >= COMPILE_TIME_LOGLEVEL
+#define PARA_CRIT_LOG(f,...) para_log(LL_CRIT, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
+#else
+#define PARA_CRIT_LOG(...) do {;} while (0)
+#endif
+
+#if LL_EMERG >= COMPILE_TIME_LOGLEVEL
+#define PARA_EMERG_LOG(f,...) para_log(LL_EMERG, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
+#else
+#define PARA_EMERG_LOG(...)
+#endif
+/** \endcond */
diff --git a/recv.h b/recv.h
index 0da3fd6948b38b6805f7076e4eeebc83e4ed68cf..271932b183a3101f147273332d4e592c49bd09d7 100644 (file)
--- a/recv.h
+++ b/recv.h
@@ -100,18 +100,6 @@ struct receiver {
        struct ggo_help help;
 };
 
-
-/** \cond */
-extern void http_recv_init(struct receiver *r);
-#define HTTP_RECEIVER {.name = "http", .init = http_recv_init},
-extern void dccp_recv_init(struct receiver *r);
-#define DCCP_RECEIVER {.name = "dccp", .init = dccp_recv_init},
-extern void udp_recv_init(struct receiver *r);
-#define UDP_RECEIVER {.name = "udp", .init = udp_recv_init},
-
-extern struct receiver receivers[];
-/** \endcond */
-
 /** Define an array of all available receivers. */
 #define DEFINE_RECEIVER_ARRAY struct receiver receivers[] = { \
        HTTP_RECEIVER \
@@ -126,3 +114,15 @@ void recv_init(void);
 void *check_receiver_arg(char *ra, int *receiver_num);
 void print_receiver_helps(int detailed);
 int generic_recv_pre_select(struct sched *s, struct task *t);
+
+/** \cond */
+extern void http_recv_init(struct receiver *r);
+#define HTTP_RECEIVER {.name = "http", .init = http_recv_init},
+extern void dccp_recv_init(struct receiver *r);
+#define DCCP_RECEIVER {.name = "dccp", .init = dccp_recv_init},
+extern void udp_recv_init(struct receiver *r);
+#define UDP_RECEIVER {.name = "udp", .init = udp_recv_init},
+
+extern struct receiver receivers[];
+/** \endcond */
+
index 8e2fcf2fde3fbb5ed94ac06816b2acd8f25f2ffb..f008f1eda30a96818d80fdbf01783186f036e341 100644 (file)
@@ -145,7 +145,8 @@ static int mcast_receiver_setup(int fd, const char *iface)
        assert(ss.ss_family == AF_INET || ss.ss_family == AF_INET6);
 
        if (iface != NULL && id == 0)
-               PARA_WARNING_LOG("could not resolve interface %s, using default", iface);
+               PARA_WARNING_LOG("could not resolve interface %s, using default\n",
+                       iface);
 
        switch (ss.ss_family) {
        case AF_INET:
@@ -160,12 +161,13 @@ static int mcast_receiver_setup(int fd, const char *iface)
 
                        m4.imr_interface.s_addr = INADDR_ANY;
                        if (id != 0)
-                               PARA_ERROR_LOG("Setting IPv4 receiver mcast interface not supported.");
+                               PARA_ERROR_LOG("Setting IPv4 receiver mcast interface not supported\n");
 
 #endif
-                       m4.imr_multiaddr        = ((struct sockaddr_in *)&ss)->sin_addr;
+                       m4.imr_multiaddr = ((struct sockaddr_in *)&ss)->sin_addr;
 
-                       if (setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &m4, sizeof(m4)) < 0)
+                       if (setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP,
+                                       &m4, sizeof(m4)) < 0)
                                break;
                }
                return 0;
index b5ea750502a452bb35261d9d3ca35a3454076159..d735d5e8f8b2cb25d24059f0741e16f03dea3411 100644 (file)
@@ -5,9 +5,12 @@
 
 <a href="versions/">download directory</a>
 
-or grab the current
+or grab a
 
-<a href="versions/paraslash-git.tar.bz2">snapshot</a>.
+<a href="versions/paraslash-git.tar.bz2">tarball</a>
+
+of the current master branch. This version is expected to be more
+stable than any of the released versions.
 
 All regular releases are <a href="PUBLIC_KEY">cryptographically signed</a>.
 
@@ -15,7 +18,7 @@ Anonymous (read-only)
 
 <a href="http://www.kernel.org/pub/software/scm/git/docs/">git</a>
 
-access is also available. Checkout a copy with </p>
+access is also available. Check out a copy with </p>
 
 <p>
 git clone git://paraslash.systemlinux.org/git paraslash