Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
IPTV: autonet - improve parsing of extra HTTP headers
  • Loading branch information
perexg committed Nov 1, 2015
1 parent ea82d9f commit 902f307
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/input/mpegts/iptv/iptv_auto.c
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 902f307

Please sign in to comment.