]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge branch 't/clang_analyzer_fixes'
authorAndre Noll <maan@systemlinux.org>
Sat, 15 Oct 2011 13:36:38 +0000 (15:36 +0200)
committerAndre Noll <maan@systemlinux.org>
Sat, 15 Oct 2011 13:36:38 +0000 (15:36 +0200)
25 files changed:
NEWS
afs.c
aft.c
attribute.c
audiod.c
audiod_command.c
autogen.sh
blob.c
command.c
crypt.c
crypt.h
daemon.c
daemon.h
error.h
ipc.c
ipc.h
mood.c
mp3_afh.c
oggdec_filter.c
para.h
playlist.c
recv.h
server.c
string.c
time.c

diff --git a/NEWS b/NEWS
index 50f9b6996c878e9e7762cddf25dbf2a9666bb277..6db7225350f014f80e3f0ad831fe60b93d2777b9 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,14 @@
 0.4.9 (to be announced) "hybrid causality"
 ------------------------------------------
 
+       - Fix for an endless loop in the mp3 decoder for certain
+         (corrupt) mp3 files.
+       - autogen.sh now detects a distcc setup and adjusts the
+         parameter for the -j option of make accordingly.
+       - Shared memory areas are no longer restricted to 64K. We now
+         detect the maximal size of a shared memory area at runtime.
+       - cleanup of the internal uptime API.
+
 --------------------------------------
 0.4.8 (2011-08-19) "nested assignment"
 --------------------------------------
diff --git a/afs.c b/afs.c
index 755537da9e436ab8705222925fa3c737f648eab1..955b8f207d5305418674f6a0f2e30f904d110517 100644 (file)
--- a/afs.c
+++ b/afs.c
@@ -537,7 +537,7 @@ static int activate_mood_or_playlist(char *arg, int *num_admissible)
 static void com_select_callback(int fd, const struct osl_object *query)
 {
        struct para_buffer pb = {
-               .max_size = SHMMAX,
+               .max_size = shm_get_shmmax(),
                .private_data = &fd,
                .max_size_handler = pass_buffer_as_shm
        };
diff --git a/aft.c b/aft.c
index f4080233855009be5423b3bc9325b861d5f20b0c..e91d734fea7d70e74350cdcfdc3c4def9bce8a05 100644 (file)
--- a/aft.c
+++ b/aft.c
@@ -1037,7 +1037,7 @@ static int make_status_items(struct audio_file_data *afd,
                .flags = LS_FLAG_FULL_PATH | LS_FLAG_ADMISSIBLE_ONLY,
                .mode = LS_MODE_VERBOSE,
        };
-       struct para_buffer pb = {.max_size = SHMMAX - 1};
+       struct para_buffer pb = {.max_size = shm_get_shmmax() - 1};
        time_t current_time;
        int ret;
 
@@ -1048,7 +1048,7 @@ static int make_status_items(struct audio_file_data *afd,
        free(status_items);
        status_items = pb.buf;
        memset(&pb, 0, sizeof(pb));
-       pb.max_size = SHMMAX - 1;
+       pb.max_size = shm_get_shmmax() - 1;
        pb.flags = PBF_SIZE_PREFIX;
        ret = print_list_item(&d, &opts, &pb, current_time);
        if (ret < 0) {
@@ -1343,7 +1343,7 @@ static void com_ls_callback(int fd, const struct osl_object *query)
 {
        struct ls_options *opts = query->data;
        char *p, *pattern_start = (char *)query->data + sizeof(*opts);
-       struct para_buffer b = {.max_size = SHMMAX,
+       struct para_buffer b = {.max_size = shm_get_shmmax(),
                .flags = (opts->mode == LS_MODE_PARSER)? PBF_SIZE_PREFIX : 0,
                .max_size_handler = pass_buffer_as_shm, .private_data = &fd};
        int i = 0, ret;
@@ -1665,7 +1665,7 @@ static void com_add_callback(int fd, const struct osl_object *query)
        char afsi_buf[AFSI_SIZE];
        uint32_t flags = read_u32(buf + CAB_FLAGS_OFFSET);
        struct afs_info default_afsi = {.last_played = 0};
-       struct para_buffer msg = {.max_size = SHMMAX,
+       struct para_buffer msg = {.max_size = shm_get_shmmax(),
                .max_size_handler = pass_buffer_as_shm, .private_data = &fd};
        uint16_t afhi_offset, chunks_offset;
 
@@ -2080,7 +2080,7 @@ static void com_touch_callback(int fd, const struct osl_object *query)
 {
        struct touch_action_data tad = {.cto = query->data,
                .pb = {
-                       .max_size = SHMMAX,
+                       .max_size = shm_get_shmmax(),
                        .private_data = &fd,
                        .max_size_handler = pass_buffer_as_shm
                }
@@ -2226,7 +2226,7 @@ static void com_rm_callback(int fd, const struct osl_object *query)
 {
        struct com_rm_action_data crd = {.flags = *(uint32_t *)query->data,
                .pb = {
-                       .max_size = SHMMAX,
+                       .max_size = shm_get_shmmax(),
                        .private_data = &fd,
                        .max_size_handler = pass_buffer_as_shm
                }
@@ -2371,7 +2371,7 @@ static void com_cpsi_callback(int fd, const struct osl_object *query)
        struct cpsi_action_data cad = {
                .flags = *(unsigned *)query->data,
                .pb = {
-                       .max_size = SHMMAX,
+                       .max_size = shm_get_shmmax(),
                        .private_data = &fd,
                        .max_size_handler = pass_buffer_as_shm
                }
@@ -2543,7 +2543,7 @@ static int check_audio_file(struct osl_row *row, void *data)
 void aft_check_callback(int fd, __a_unused const struct osl_object *query)
 {
        struct para_buffer pb = {
-               .max_size = SHMMAX,
+               .max_size = shm_get_shmmax(),
                .private_data = &fd,
                .max_size_handler = pass_buffer_as_shm
        };
index 42fa421cbbfff275afb9a6d1691911483159bbe7..f36f4e7d91f7aae22fe9e039dd86ce30e0f3538b 100644 (file)
@@ -149,7 +149,7 @@ static void com_lsatt_callback(int fd, const struct osl_object *query)
        struct lsatt_action_data laad = {
                .flags = *(unsigned *) query->data,
                .pb = {
-                       .max_size = SHMMAX,
+                       .max_size = shm_get_shmmax(),
                        .private_data = &fd,
                        .max_size_handler = pass_buffer_as_shm
                }
@@ -295,7 +295,7 @@ static void com_addatt_callback(int fd, const struct osl_object *query)
        char *p;
        int ret = 1, ret2 = 0;
        struct para_buffer pb = {
-               .max_size = SHMMAX,
+               .max_size = shm_get_shmmax(),
                .private_data = &fd,
                .max_size_handler = pass_buffer_as_shm
        };
@@ -378,7 +378,7 @@ static void com_mvatt_callback(int fd, const struct osl_object *query)
        struct osl_object obj = {.data = old, .size = size};
        struct osl_row *row;
        struct para_buffer pb = {
-               .max_size = SHMMAX,
+               .max_size = shm_get_shmmax(),
                .private_data = &fd,
                .max_size_handler = pass_buffer_as_shm
        };
@@ -448,7 +448,7 @@ static void com_rmatt_callback(int fd, const struct osl_object *query)
        struct remove_attribute_action_data raad = {
                .num_removed = 0,
                .pb = {
-                       .max_size = SHMMAX,
+                       .max_size = shm_get_shmmax(),
                        .private_data = &fd,
                        .max_size_handler = pass_buffer_as_shm
                }
index c78df5b83bab6e0685eda33274c68a2f8f3f454f..4864c8550d35d66d813c9a553685f8cc761acd88 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -1370,7 +1370,7 @@ int main(int argc, char *argv[])
                exit(EXIT_FAILURE);
        }
        log_welcome("para_audiod");
-       server_uptime(UPTIME_SET);
+       set_server_start_time(NULL);
        set_initial_status();
        FOR_EACH_SLOT(i)
                clear_slot(i);
index 1c22f58b3eea76d91d89af50196c0fbed7c8ab31..dfb014aebc1c1d12659364189ac79813c952139c 100644 (file)
@@ -480,7 +480,7 @@ void audiod_status_dump(void)
                        free(new);
        }
 
-       new = uptime_str();
+       new = get_server_uptime_str(now);
        old = stat_item_values[SI_AUDIOD_UPTIME];
        if (!old || strcmp(old, new)) {
                free(old);
index e5000a6fd70cddc63b1f2a2dc21f54bc760641bc..ea38dbf7ac901be9265427f4f91748fcfafebc09 100755 (executable)
@@ -5,6 +5,11 @@ if [ -z "$n" ]; then
        n=$(grep ^processor /proc/cpuinfo 2>/dev/null | wc -l)
        [ $n -eq 0 ] && n=1
 fi
+# If we are compiling with distcc, try to guess a reasonable number
+# based on (a) the number of cores on this machine and (b) the number
+# of words in the DISTCC_HOSTS variable.
+d="$(echo $DISTCC_HOSTS | wc -w)"
+n=$(($n + 2 * $n * $d))
 echo preparing, parallel=$n...
 if test -f Makefile; then
        make maintainer-clean > /dev/null 2>&1
diff --git a/blob.c b/blob.c
index 25aa2a6dc323ed99efba3a78d247c25b27205da1..707c6c6254b88a359a5297c469a1f3105528e5bc 100644 (file)
--- a/blob.c
+++ b/blob.c
@@ -80,12 +80,13 @@ static struct osl_column_description blob_cols[] = {
        DEFINE_BLOB_TABLE_DESC(table_name); \
        DEFINE_BLOB_TABLE_PTR(table_name);
 
-/** \cond doxygen isn't smart enough to recognize these */
+/* doxygen isn't smart enough to recognize these */
+/** \cond blob_table */
 INIT_BLOB_TABLE(lyrics);
 INIT_BLOB_TABLE(images);
 INIT_BLOB_TABLE(moods);
 INIT_BLOB_TABLE(playlists);
-/** \endcond */
+/** \endcond blob_table */
 
 /** Flags that may be passed to the \p ls functions of each blob  type. */
 enum blob_ls_flags {
@@ -130,7 +131,7 @@ static void com_lsblob_callback(struct osl_table *table,
        struct lsblob_action_data lbad = {
                .flags = *(uint32_t *)query->data,
                .pb = {
-                       .max_size = SHMMAX,
+                       .max_size = shm_get_shmmax(),
                        .private_data = &fd,
                        .max_size_handler = pass_buffer_as_shm
                }
@@ -261,7 +262,7 @@ static void com_rmblob_callback(struct osl_table *table, int fd,
        struct rmblob_data rmbd = {
                .num_removed = 0,
                .pb = {
-                       .max_size = SHMMAX,
+                       .max_size = shm_get_shmmax(),
                        .private_data = &fd,
                        .max_size_handler = pass_buffer_as_shm
                }
@@ -662,9 +663,10 @@ static int blob_open(struct osl_table **table,
        DEFINE_GET_DEF_BY_NAME(table_name, cmd_prefix); \
        DEFINE_GET_NAME_AND_DEF_BY_ROW(table_name, cmd_prefix); \
 
-/** \cond doxygen isn't smart enough to recognize these */
+/* doxygen isn't smart enough to recognize these */
+/** \cond blob_function */
 DEFINE_BLOB_FUNCTIONS(lyrics, lyr);
 DEFINE_BLOB_FUNCTIONS(images, img);
 DEFINE_BLOB_FUNCTIONS(moods, mood);
 DEFINE_BLOB_FUNCTIONS(playlists, pl);
-/** \endcond */
+/** \endcond blob_function */
index 74d82697dd241c8c435bf2f78d0052a1b5df9b10..b6861b88bbcb36621109f6d9ac7fe80546a42b35 100644 (file)
--- a/command.c
+++ b/command.c
@@ -108,7 +108,8 @@ static char *get_status(struct misc_meta_data *nmmd, int parser_friendly)
 {
        char mtime[30] = "";
        char *status, *flags; /* vss status info */
-       char *ut = uptime_str();
+       /* nobody updates our version of "now" */
+       char *ut = get_server_uptime_str(NULL);
        long offset = (nmmd->offset + 500) / 1000;
        struct timeval current_time;
        struct tm mtime_tm;
@@ -258,7 +259,7 @@ int com_si(struct stream_cipher_context *scc, int argc, __a_unused char * const
                sender_info = para_strcat(sender_info, info);
                free(info);
        }
-       ut = uptime_str();
+       ut = get_server_uptime_str(now);
        ret = sc_send_va_buffer(scc, "version: " GIT_VERSION "\n"
                "up: %s\nplayed: %u\n"
                "server_pid: %d\n"
diff --git a/crypt.c b/crypt.c
index 207ad5db4e9f264091076d404adb06e12b95e8e4..431de6fe807f5a08acb8d4e62e0e6e3c160b6e1c 100644 (file)
--- a/crypt.c
+++ b/crypt.c
@@ -307,7 +307,7 @@ int sc_send_bin_buffer(struct stream_cipher_context *scc, char *buf,
 int sc_recv_bin_buffer(struct stream_cipher_context *scc, char *buf,
                size_t size)
 {
-       unsigned char *tmp = para_malloc(size);
+       unsigned char *tmp = para_malloc(ROUND_UP(size, RC4_ALIGN));
        ssize_t ret = recv(scc->fd, tmp, size, 0);
 
        if (ret > 0)
diff --git a/crypt.h b/crypt.h
index 4696ee4a118c5791cfa40ae5cef2c4eb634807ef..833bbf1b87e5d8a34fff91d4558820ee33191d27 100644 (file)
--- a/crypt.h
+++ b/crypt.h
@@ -7,13 +7,14 @@
 /** \file crypt.h Public crypto interface. */
 
 
-/** \cond used to distinguish between loading of private/public key */
+/* These are used to distinguish between loading of private/public key. */
+
+/** The key to load is a public key. */
 #define LOAD_PUBLIC_KEY 0
+/** The key to load is a private key. */
 #define LOAD_PRIVATE_KEY 1
+/** The size of the challenge sent to the client. */
 #define CHALLENGE_SIZE 64
-/** \endcond **/
-
-/* asymetric (public key) crypto */
 
 /** Opaque structure for public and private keys. */
 struct asymmetric_key;
index b7a0a3267b68df5b020159f90c56337073463244..ffdec4e35f3e8cdbd113a780f6d6ade7faf9fcfe 100644 (file)
--- a/daemon.c
+++ b/daemon.c
@@ -26,7 +26,6 @@ struct daemon {
        char *logfile_name;
        /** Current loglevel, see \ref daemon_set_loglevel(). */
        int loglevel;
-
        /** Used by \ref server_uptime() and \ref uptime_str(). */
        time_t startuptime;
        /** The file pointer if the logfile is open. */
@@ -277,43 +276,59 @@ void drop_privileges_or_die(const char *username, const char *groupname)
 }
 
 /**
- * Set/get the server uptime.
+ * Set the server startup time.
+ *
+ * \param startuptime The value to store as the server start time.
  *
- * \param set_or_get Chose one of the two modes.
+ * This should be called once on startup with \a startuptime either NULL or a
+ * pointer to a struct timeval which contains the current time. If \a
+ * startuptime is NULL, the server start time is set to the current time.
  *
- * This should be called at startup time with \a set_or_get equal to \p
- * UPTIME_SET which sets the uptime to zero.  Subsequent calls with \a
- * set_or_get equal to \p UPTIME_GET return the uptime.
+ * \sa time(2), difftime(3) \ref get_server_uptime(), \ref
+ * get_server_uptime_str().
+ */
+void set_server_start_time(const struct timeval *startuptime)
+{
+       if (startuptime)
+               me->startuptime = startuptime->tv_sec;
+       else
+               time(&me->startuptime);
+}
 
- * \return Zero if called with \a set_or_get equal to \p UPTIME_SET, the number
- * of seconds elapsed since the last reset otherwise.
+/**
+ * Get the server uptime.
+ *
+ * \param current_time The current time.
+ *
+ * The \a current_time pointer may be \p NULL. In this case the function
+ * obtains the current time from the system.
  *
- * \sa time(2), difftime(3).
+ * \return This returns the server uptime in seconds, i.e. the difference
+ * between the current time and the value stored previously via \ref
+ * set_server_start_time().
  */
-time_t server_uptime(enum uptime set_or_get)
+time_t get_server_uptime(const struct timeval *current_time)
 {
-       time_t now;
-       double diff;
+       time_t t;
 
-       if (set_or_get == UPTIME_SET) {
-               time(&me->startuptime);
-               return 0;
-       }
-       time(&now);
-       diff = difftime(now, me->startuptime);
-       return (time_t) diff;
+       if (current_time)
+               return current_time->tv_sec - me->startuptime;
+       time(&t);
+       return difftime(t, me->startuptime);
 }
 
 /**
- * Construct string containing uptime.
+ * Construct a string containing the current uptime.
+ *
+ * \param current_time See a \ref get_server_uptime().
  *
  * \return A dynamically allocated string of the form "days:hours:minutes".
  *
  * \sa server_uptime.
  */
-__malloc char *uptime_str(void)
+__malloc char *get_server_uptime_str(const struct timeval *current_time)
 {
-       long t = server_uptime(UPTIME_GET);
+       long t = get_server_uptime(current_time);
        return make_message("%li:%02li:%02li", t / 86400,
                (t / 3600) % 24, (t / 60) % 60);
 }
index 4e803bdc4aa18df8bf124e53d1c024ed65cf2fef..d5583f580e8ec3f2af9456b564e47c13521a4af4 100644 (file)
--- a/daemon.h
+++ b/daemon.h
@@ -7,9 +7,9 @@ void daemon_close_log(void);
 void log_welcome(const char *whoami);
 void drop_privileges_or_die(const char *username, const char *groupname);
 /** used for server_uptime() */
-enum uptime {UPTIME_SET, UPTIME_GET};
-time_t server_uptime(enum uptime set_or_get);
-__malloc char *uptime_str(void);
+void set_server_start_time(const struct timeval *startuptime);
+time_t get_server_uptime(const struct timeval *current_time);
+__malloc char *get_server_uptime_str(const struct timeval *current_time);
 void daemon_set_logfile(char *logfile_name);
 void daemon_set_flag(unsigned flag);
 void daemon_clear_flag(unsigned flag);
diff --git a/error.h b/error.h
index 306546d6c89bfdd2ee80832ed4c71b655bdf7b05..65494131ba518827dc3df6c228ca8d776a01fa71 100644 (file)
--- a/error.h
+++ b/error.h
@@ -6,7 +6,7 @@
 
 /** \file error.h List of error messages for all subsystems. */
 
-/** \cond */
+/** \cond errors */
 
 /* List of all subsystems that use paraslash's error facility. */
 DEFINE_ERRLIST_OBJECT_ENUM;
@@ -455,7 +455,7 @@ extern const char **para_errlist[];
        PARA_ERROR(QUEUE, "packet queue overrun"), \
 
 
-/** \endcond */
+/** \endcond errors */
 
 /**
  * The subsystem shift.
diff --git a/ipc.c b/ipc.c
index c1069ad9af067a026c794663be96518351eec8ee..674d1cb01e5fae9c5ae2ecb8f8ceec92fa9faa62 100644 (file)
--- a/ipc.c
+++ b/ipc.c
@@ -9,6 +9,10 @@
 #include "para.h"
 #include "error.h"
 #include "ipc.h"
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/sysctl.h>
+
 #include <sys/ipc.h>
 #include <sys/shm.h>
 #include <sys/sem.h>
@@ -171,3 +175,45 @@ int shm_detach(void *addr)
        int ret = shmdt(addr);
        return ret < 0? -ERRNO_TO_PARA_ERROR(errno) : 1;
 }
+
+# if defined __FreeBSD__ || defined __NetBSD__
+#      define SYSCTL_SHMMAX_VARIABLE "kern.ipc.shmmax"
+# elif defined __APPLE__
+#      define SYSCTL_SHMMAX_VARIABLE "kern.sysv.shmmax"
+# else
+#      undef SYSCTL_SHMMAX_VARIABLE
+# endif
+
+size_t shm_get_shmmax(void)
+{
+       static size_t shmmax;
+
+       if (shmmax > 0) /* only dance once */
+               return shmmax;
+#ifdef __linux__ /* get it from proc fs */
+       {
+               int fd = open("/proc/sys/kernel/shmmax", O_RDONLY);
+               if (fd >= 0) {
+                       char buf[100] = "";
+                       int ret = read(fd, buf, sizeof(buf) - 1);
+                       if (ret > 0) {
+                               buf[ret] = '\0';
+                               shmmax = strtoul(buf, NULL, 10);
+                       }
+               }
+       }
+#elif defined SYSCTL_SHMMAX_VARIABLE
+       {
+               size_t len = sizeof(shmmax);
+               sysctlbyname(SYSCTL_SHMMAX_VARIABLE, &shmmax, &len, NULL, 0);
+       }
+#elif defined SHMMAX
+       shmmax = SHMMAX;
+#endif
+       if (shmmax == 0) {
+               PARA_WARNING_LOG("unable to determine shmmax\n");
+               shmmax = 65535; /* last ressort */
+       }
+       PARA_INFO_LOG("shmmax: %zu\n", shmmax);
+       return shmmax;
+}
diff --git a/ipc.h b/ipc.h
index 71e09ec1d1a7a21ea5a7fcab5bfb47835c70e464..c8d31c0c991641a1f71627c855705bdf7decd5c6 100644 (file)
--- a/ipc.h
+++ b/ipc.h
@@ -11,7 +11,4 @@ int shm_new(size_t size);
 int shm_attach(int id, enum shm_attach_mode mode, void **result);
 int shm_detach(void *addr);
 int shm_destroy(int id);
-
-#ifndef SHMMAX
-#define SHMMAX 65535
-#endif
+size_t shm_get_shmmax(void);
diff --git a/mood.c b/mood.c
index 93461ee845c558ec30c0da78bf548939f1247857..d9ae48bf967e61b0c4c0ca499d75f0b47eb47b96 100644 (file)
--- a/mood.c
+++ b/mood.c
@@ -422,7 +422,7 @@ out:
 void mood_check_callback(int fd, __a_unused const struct osl_object *query)
 {
        struct para_buffer pb = {
-               .max_size = SHMMAX,
+               .max_size = shm_get_shmmax(),
                .private_data = &fd,
                .max_size_handler = pass_buffer_as_shm
        };
index b0d44ec991cb49568eb20b4a4106928ae5363f4e..d72d85e7fb3720d67feab92fc140d4f01acdde4e 100644 (file)
--- a/mp3_afh.c
+++ b/mp3_afh.c
@@ -23,8 +23,6 @@
 #include "afh.h"
 #include "string.h"
 
-/** \cond some defines and structs which are only used in this file */
-
 /*
  * MIN_CONSEC_GOOD_FRAMES defines how many consecutive valid MP3 frames we need
  * to see before we decide we are looking at a real MP3 file
@@ -47,7 +45,6 @@ struct mp3header {
        unsigned int emphasis;
 };
 
-/** \endcond */
 static const int frequencies[3][4] = {
        {22050,24000,16000,50000}, /* MPEG 2.0 */
        {44100,48000,32000,50000}, /* MPEG 1.0 */
index 32ffdef97462a9bf3a3509a25b865f69ed8fe8c5..07e4cec1c1d6ac99fcc482beedf77914d1d157b7 100644 (file)
@@ -175,6 +175,7 @@ out:
                pod->converted = 0;
                fn->min_iqs = 0;
                pod->vf = vf;
+               pod->have_more = true;
        }
        return ret;
 }
diff --git a/para.h b/para.h
index 5dc3912409b5dd64c71a0d68e2fcbbde2cfe466a..bc6aa929539ee4a9c1abb8e0d2b14695d88870cc 100644 (file)
--- a/para.h
+++ b/para.h
@@ -229,12 +229,12 @@ _static_inline_ long int para_random(unsigned max)
        SAMPLE_FORMAT(SF_U16_LE, "16 bit unsigned, little endian"), \
        SAMPLE_FORMAT(SF_U16_BE, "16 bit unsigned, big endian"), \
 
-/** \cond */
+/** \cond sample_format */
 #define SAMPLE_FORMAT(a, b) a
 enum sample_format {SAMPLE_FORMATS};
 #undef SAMPLE_FORMAT
 #define SAMPLE_FORMAT(a, b) b
-/** \endcond */
+/** \endcond sample_format */
 
 /** Debug loglevel, gets really noisy. */
 #define LL_DEBUG 0
@@ -256,7 +256,7 @@ enum sample_format {SAMPLE_FORMATS};
 /** Log messages with lower priority than that will not be compiled in. */
 #define COMPILE_TIME_LOGLEVEL 0
 
-/** \cond */
+/** \cond log */
 #if LL_DEBUG >= COMPILE_TIME_LOGLEVEL
 #define PARA_DEBUG_LOG(f,...) para_log(LL_DEBUG, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
 #else
@@ -298,4 +298,4 @@ enum sample_format {SAMPLE_FORMATS};
 #else
 #define PARA_EMERG_LOG(...)
 #endif
-/** \endcond */
+/** \endcond log */
index 2d2f23b4eb9c6df6b2d9ff9157a9716f09c1fcc6..806e49d55f68502fb38daffc33620cb075bbd1b3 100644 (file)
@@ -131,7 +131,7 @@ static int check_playlist(struct osl_row *row, void *data)
 void playlist_check_callback(int fd, __a_unused const struct osl_object *query)
 {
        struct para_buffer pb = {
-               .max_size = SHMMAX,
+               .max_size = shm_get_shmmax(),
                .private_data = &fd,
                .max_size_handler = pass_buffer_as_shm
        };
diff --git a/recv.h b/recv.h
index ee8138f9d9c12a9674600091d3073b1807dc41ba..7555dfb4130010898145bb6bb89b679a5e69e78a 100644 (file)
--- a/recv.h
+++ b/recv.h
@@ -121,7 +121,7 @@ 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 */
+/** \cond receiver */
 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);
@@ -130,5 +130,5 @@ extern void udp_recv_init(struct receiver *r);
 #define UDP_RECEIVER {.name = "udp", .init = udp_recv_init},
 
 extern struct receiver receivers[];
-/** \endcond */
+/** \endcond receiver */
 
index 142e2abb4c982457e2b51b250207e4eedeb77605..15ae5c9a296be654471fd1f95aa9395629fae097 100644 (file)
--- a/server.c
+++ b/server.c
@@ -491,7 +491,7 @@ static void server_init(int argc, char **argv)
        init_ipc_or_die(); /* init mmd struct and mmd->lock */
        /* make sure, the global now pointer is uptodate */
        gettimeofday(now, NULL);
-       server_uptime(UPTIME_SET); /* reset server uptime */
+       set_server_start_time(now);
        init_user_list(user_list_file);
        /* become daemon */
        if (conf.daemon_given)
@@ -525,7 +525,7 @@ static void server_init(int argc, char **argv)
 static void status_refresh(void)
 {
        static int prev_uptime = -1, prev_events = -1;
-       int uptime = server_uptime(UPTIME_GET), ret = 1;
+       int uptime = get_server_uptime(now);
 
        if (prev_events != mmd->events)
                goto out;
@@ -540,11 +540,8 @@ out:
        prev_uptime = uptime;
        prev_events = mmd->events;
        mmd->vss_status_flags = mmd->new_vss_status_flags;
-       if (ret) {
-               PARA_DEBUG_LOG("%d events, forcing status update\n",
-                       mmd->events);
-               killpg(0, SIGUSR1);
-       }
+       PARA_DEBUG_LOG("%d events, forcing status update\n", mmd->events);
+       killpg(0, SIGUSR1);
 }
 
 static int server_select(int max_fileno, fd_set *readfds, fd_set *writefds,
index 0a32c0f48b3b8fc9a1b5194587fc10068789a064..cefb45d674075cf1fcb2e42b42e5b0a929a52c16 100644 (file)
--- a/string.c
+++ b/string.c
@@ -521,14 +521,15 @@ __printf_2_3 int para_printf(struct para_buffer *b, const char *fmt, ...)
        }
 }
 
-/** \cond LLONG_MAX and LLONG_MIN might not be defined. */
+/** \cond llong_minmax */
+/* LLONG_MAX and LLONG_MIN might not be defined. */
 #ifndef LLONG_MAX
 #define LLONG_MAX 9223372036854775807LL
 #endif
 #ifndef LLONG_MIN
 #define LLONG_MIN (-LLONG_MAX - 1LL)
 #endif
-/** \endcond */
+/** \endcond llong_minmax */
 
 /**
  * Convert a string to a 64-bit signed integer value.
diff --git a/time.c b/time.c
index 3ec2a2d437422f39e9845b7f519e01ae4216b89c..d7d803d932efd704642f9098989f6661f2731377 100644 (file)
--- a/time.c
+++ b/time.c
@@ -82,7 +82,7 @@ int tv_diff(const struct timeval *b, const struct timeval *a, struct timeval *di
  *
  * \param a First addend.
  * \param b Second addend.
- * \param sum Contains the sum \a + \a b on return.
+ * \param sum Contains the sum \a + \a b on return.
  */
 void tv_add(const struct timeval *a, const struct timeval *b,
        struct timeval *sum)
@@ -180,7 +180,7 @@ int tv_convex_combination(const long a, const struct timeval *tv1,
  * \param stream_start When the first chunk was sent.
  * \param result The time when to send chunk number \a chunk_num.
  *
- * This function computes stream_start + chunk_num * chunk_time.
+ * This function computes \a stream_start + \a chunk_num * \a chunk_time.
  */
 void compute_chunk_time(long unsigned chunk_num,
                struct timeval *chunk_tv, struct timeval *stream_start,