From: Jaroslav Kysela Date: Sun, 1 Nov 2015 15:07:39 +0000 (+0100) Subject: IPTV: autonet - improve parsing of extra HTTP headers X-Git-Tag: v4.2.1~1705 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=902f307958a66d1e5b2391309ac44c4b69d326ef;p=thirdparty%2Ftvheadend.git IPTV: autonet - improve parsing of extra HTTP headers --- diff --git a/src/input/mpegts/iptv/iptv_auto.c b/src/input/mpegts/iptv/iptv_auto.c index d688b7457..4beb87786 100644 --- a/src/input/mpegts/iptv/iptv_auto.c +++ b/src/input/mpegts/iptv/iptv_auto.c @@ -106,6 +106,7 @@ iptv_auto_network_process_m3u_item(iptv_network_t *in, http_arg_list_t args; http_arg_t *ra1, *ra2, *ra2_next; htsbuf_queue_t q; + int delim; size_t l; char url2[512], custom[512], name2[128], buf[32], *n, *x = NULL, *y; @@ -136,13 +137,14 @@ iptv_auto_network_process_m3u_item(iptv_network_t *in, if (strncmp(url, "http://", 7) == 0 || strncmp(url, "https://", 8) == 0) { url = n = strdupa(url); + delim = 0; while (*n && *n != ' ' && *n != '|') n++; - if (*n) { *n = '\0'; n++; } + if (*n) { delim = *n; *n = '\0'; n++; } l = 0; while (*n) { while (*n && *n <= ' ') n++; y = n; - while (*n && *n != ' ' && *n != '|') n++; + while (*n && *n != delim) n++; if (*n) { *n = '\0'; n++; } if (*y) tvh_strlcatf(custom, sizeof(custom), l, "%s\n", y);