diff options
author | waker <wakeroid@gmail.com> | 2010-10-30 14:11:21 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2010-10-30 14:11:21 +0200 |
commit | 7314243400eaf8bb62d236cbf8b653b38b662d76 (patch) | |
tree | 08407888a6be0602294f6dc7f136e34981e0a2de | |
parent | e684c517f61e16cf5daa38006574ca17bd26711b (diff) |
fixed vfs_curl stream length regression
-rw-r--r-- | plugins/vfs_curl/vfs_curl.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/vfs_curl/vfs_curl.c b/plugins/vfs_curl/vfs_curl.c index c3a627bd..048f964e 100644 --- a/plugins/vfs_curl/vfs_curl.c +++ b/plugins/vfs_curl/vfs_curl.c @@ -229,7 +229,6 @@ http_curl_write (void *ptr, size_t size, size_t nmemb, void *stream) { if (!fp->icyheader && avail >= 10 && !memcmp (ptr, "ICY 200 OK", 10)) { trace ("icy headers in the stream\n"); fp->icyheader = 1; - fp->length = -1; } if (fp->icyheader) { if (fp->nheaderpackets > 10) { @@ -392,6 +391,11 @@ http_content_header_handler (void *ptr, size_t size, size_t nmemb, void *stream) uint8_t key[256]; uint8_t value[256]; int refresh_playlist = 0; + + if (fp->length == 0) { + fp->length = -1; + } + while (p < end) { if (p <= end - 4) { if (!memcmp (p, "\r\n\r\n", 4)) { @@ -412,9 +416,7 @@ http_content_header_handler (void *ptr, size_t size, size_t nmemb, void *stream) fp->content_type = strdup (value); } else if (!strcasecmp (key, "Content-Length")) { - if (!fp->icyheader) { // icy streams must be infinite - fp->length = atoi (value); - } + fp->length = atoi (value); } else if (!strcasecmp (key, "icy-name")) { if (fp->track) { |