From: Andre Noll Date: Fri, 1 Jan 2021 15:14:13 +0000 (+0100) Subject: Merge branch 'refs/heads/t/fec' X-Git-Tag: v0.6.3~2 X-Git-Url: http://git.tuebingen.mpg.de/?a=commitdiff_plain;h=5d27648bfa9921f158e700151296af3e4c4fe13c;hp=35cab857b6b87782be4549c767cb9013128a74e5;p=paraslash.git Merge branch 'refs/heads/t/fec' A single patch which improves the memory management of the fec encoder. Cooking for half a year. * refs/heads/t/fec: vss: Fix NULL pointer dereference in vss_del_fec_client(). vss: Rework fec client setup. --- diff --git a/NEWS.md b/NEWS.md index de0aa1b4..6bd58962 100644 --- a/NEWS.md +++ b/NEWS.md @@ -29,6 +29,7 @@ NEWS - A fix for an old bug that could cause the server to crash or report garbage in its status output. - New para_play option: --end-of-playlist +- Streaming m4a files over udp has been improved. -------------------------------------- 0.6.2 (2018-06-30) "elastic diversity" diff --git a/afs.c b/afs.c index 04eed550..c4de2e8f 100644 --- a/afs.c +++ b/afs.c @@ -1043,7 +1043,8 @@ static int com_init_callback(struct afs_callback_arg *aca) } ret = open_afs_tables(); if (ret < 0) - para_printf(&aca->pbout, "cannot open afs tables\n"); + para_printf(&aca->pbout, "cannot open afs tables: %s\n", + para_strerror(-ret)); out: return ret; } diff --git a/aft.c b/aft.c index b4adbacf..eb955e01 100644 --- a/aft.c +++ b/aft.c @@ -407,7 +407,7 @@ static void load_chunk_table(struct afh_info *afhi, const struct osl_object *ct) int i; size_t sz; - if (!ct->data || ct->size < 4) { + if (!ct->data || ct->size < 4 * (afhi->chunks_total + 1)) { afhi->chunk_table = NULL; return; } @@ -589,8 +589,10 @@ static int get_hash_of_row(const struct osl_row *row, unsigned char **hash) int get_afhi_of_row(const struct osl_row *row, struct afh_info *afhi) { struct osl_object obj; - int ret = osl(osl_get_object(audio_file_table, row, AFTCOL_AFHI, - &obj)); + int ret; + + assert(row); + ret = osl(osl_get_object(audio_file_table, row, AFTCOL_AFHI, &obj)); if (ret < 0) return ret; load_afhi(obj.data, afhi); @@ -2534,10 +2536,12 @@ static int aft_open(const char *dir) PARA_NOTICE_LOG("current audio file hash lookup: success\n"); return 1; } - PARA_NOTICE_LOG("failed to open audio file table\n"); audio_file_table = NULL; - if (ret == -OSL_ERRNO_TO_PARA_ERROR(E_OSL_NOENT)) + if (ret == -OSL_ERRNO_TO_PARA_ERROR(E_OSL_NOENT)) { + PARA_WARNING_LOG("no audio file table\n"); return 1; + } + PARA_NOTICE_LOG("failed to open audio file table\n"); return ret; } @@ -2618,8 +2622,10 @@ static int aft_event_handler(enum afs_events event, struct para_buffer *pb, /* * These events are rare. We don't bother to check whether the * current status items are affected and simply recreate them - * every time. + * whenever an audio file is open. */ + if (!current_aft_row) + return 0; ret = get_afhi_of_row(current_aft_row, &status_item_ls_data.afhi); if (ret < 0) diff --git a/client_common.c b/client_common.c index a7eee85d..dc24a628 100644 --- a/client_common.c +++ b/client_common.c @@ -86,7 +86,7 @@ static void client_pre_select(struct sched *s, void *context) else if (ret > 0) para_fd_set(ct->scc.fd, &s->wfds, &s->max_fileno); } - /* fallthrough */ + __attribute__ ((fallthrough)); case CL_EXECUTING: if (ct->btrn[0]) { ret = btr_node_status(ct->btrn[0], 0, BTR_NT_ROOT); @@ -389,7 +389,7 @@ static int client_post_select(struct sched *s, void *context) btr_consume(ct->btrn[1], sz); } } - /* fall through */ + __attribute__ ((fallthrough)); case CL_EXECUTING: if (ct->btrn[0]) { ret = btr_node_status(ct->btrn[0], 0, BTR_NT_ROOT); diff --git a/crypt.h b/crypt.h index 85629591..9623a003 100644 --- a/crypt.h +++ b/crypt.h @@ -158,7 +158,7 @@ _static_inline_ void sc_trafo(struct iovec *src, struct iovec *dst, /** * Deallocate a stream cipher structure. * - * \param sc A stream cipher previously obtained by sc_new(). + * \param sc A stream cipher previously obtained by \ref sc_new(). */ void sc_free(struct stream_cipher *sc); @@ -188,7 +188,7 @@ void hash_function(const char *data, unsigned long len, unsigned char *hash); * will be filled by the function with the ascii representation of the hash * value given by \a hash, and a terminating \p NULL byte. */ -void hash_to_asc(unsigned char *hash, char *asc); +void hash_to_asc(const unsigned char *hash, char *asc); /** * Compare two hashes. @@ -199,4 +199,4 @@ void hash_to_asc(unsigned char *hash, char *asc); * \return 1, -1, or zero, depending on whether \a h1 is greater than, * less than or equal to h2, respectively. */ -int hash_compare(unsigned char *h1, unsigned char *h2); +int hash_compare(const unsigned char *h1, const unsigned char *h2); diff --git a/crypt_common.c b/crypt_common.c index c1e40d92..ff24e356 100644 --- a/crypt_common.c +++ b/crypt_common.c @@ -135,7 +135,7 @@ int check_private_key_file(const char *file) return 1; } -void hash_to_asc(unsigned char *hash, char *asc) +void hash_to_asc(const unsigned char *hash, char *asc) { int i; const char hexchar[] = "0123456789abcdef"; @@ -147,7 +147,7 @@ void hash_to_asc(unsigned char *hash, char *asc) asc[2 * HASH_SIZE] = '\0'; } -int hash_compare(unsigned char *h1, unsigned char *h2) +int hash_compare(const unsigned char *h1, const unsigned char *h2) { int i; diff --git a/dccp_send.c b/dccp_send.c index 55f189ad..bca7ad67 100644 --- a/dccp_send.c +++ b/dccp_send.c @@ -232,6 +232,8 @@ static void dccp_send_init(void) OPT_RESULT(DCCP_LISTEN_ADDRESS), OPT_UINT32_VAL(DCCP_PORT), OPT_UINT32_VAL(DCCP_MAX_CLIENTS), OPT_GIVEN(DCCP_DEFAULT_DENY)); + if (OPT_GIVEN(DCCP_NO_AUTOSTART)) + return; generic_com_on(dss, IPPROTO_DCCP); } diff --git a/gui.c b/gui.c index a4f1717c..d779ff86 100644 --- a/gui.c +++ b/gui.c @@ -192,7 +192,7 @@ static bool curses_active(void) } /* taken from mutt */ -static char *km_keyname(int c) +static const char *km_keyname(int c) { static char buf[10]; @@ -1049,6 +1049,7 @@ static void handle_command(int c) { int i; const struct lls_opt_result *lor = OPT_RESULT(KEY_MAP); + const char *keyname = km_keyname(c); /* first check user-defined key bindings */ FOR_EACH_KEY_MAP(i) { @@ -1059,7 +1060,7 @@ static void handle_command(int c) free(tmp); return; } - if (strcmp(tmp, km_keyname(c))) { + if (strcmp(tmp, keyname)) { free(tmp); continue; } @@ -1079,13 +1080,13 @@ static void handle_command(int c) } /* not found, check internal key bindings */ for (i = 0; command_list[i].handler; i++) { - if (!strcmp(km_keyname(c), command_list[i].key)) { + if (!strcmp(keyname, command_list[i].key)) { command_list[i].handler(); return; } } print_in_bar(COLOR_ERRMSG, "key '%s' is not bound, press ? for help", - km_keyname(c)); + keyname); } static int input_post_select(__a_unused struct sched *s, diff --git a/gui_theme.c b/gui_theme.c index f0efaa88..6f4acf37 100644 --- a/gui_theme.c +++ b/gui_theme.c @@ -149,7 +149,7 @@ static void init_theme_colorful_blackness(struct gui_theme *t) d[SI_format].align = CENTER; d[SI_format].x = 42; d[SI_format].y = 17; - d[SI_format].len = 18; + d[SI_format].len = 16; d[SI_num_played].prefix = "#"; d[SI_num_played].postfix = ""; diff --git a/m4/lls/server.suite.m4 b/m4/lls/server.suite.m4 index be8f02f5..93e4b573 100644 --- a/m4/lls/server.suite.m4 +++ b/m4/lls/server.suite.m4 @@ -273,6 +273,11 @@ version-string = GIT_VERSION() [help] See --http-access for details. [/help] + [option dccp-no-autostart] + summary = do not open the DCCP port on startup + [help] + This is like --http-no-autostart but applies to the dccp sender. + [/help] [option dccp-max-clients] summary = maximal number of simultaneous dccp connections arg_info = required_arg diff --git a/mp.c b/mp.c index bade05bc..56c16e31 100644 --- a/mp.c +++ b/mp.c @@ -491,10 +491,10 @@ int mp_init(const char *definition, int nbytes, struct mp_context **result, struct mp_context *ctx; struct yy_buffer_state *buffer_state; + *result = NULL; if (!definition || nbytes == 0) { /* dummy mood */ if (errmsg) *errmsg = NULL; - *result = NULL; return 0; } ctx = para_calloc(sizeof(*ctx)); diff --git a/prebuffer_filter.c b/prebuffer_filter.c index 05ceb88c..1988e6e0 100644 --- a/prebuffer_filter.c +++ b/prebuffer_filter.c @@ -60,6 +60,9 @@ static int prebuffer_post_select(__a_unused struct sched *s, void *context) int ret; ret = task_get_notification(fn->task); + if (ret < 0) + return ret; + ret = btr_node_status(btrn, size, BTR_NT_INTERNAL); if (ret < 0) return ret; if (ppd->barrier.tv_sec == 0)