Commit af92b1c2 authored by Max Kellermann's avatar Max Kellermann

input/curl: don't abort if a packet has only metadata

When a received chunk of data has only icy-metadata, there was no usable data left for input_curl_read() to return, and thus it returned 0 bytes. "0" however is a special value for "end of file" or "error". This patch makes input_curl_read() read more data from the socket, until the read request can be fulfilled (or until there's really EOF).
parent 01655809
ver 0.15.5 (2009/??/??) ver 0.15.5 (2009/??/??)
* input:
- curl: don't abort if a packet has only metadata
ver 0.15.4 (2009/10/03) ver 0.15.4 (2009/10/03)
......
...@@ -443,6 +443,7 @@ input_curl_read(struct input_stream *is, void *ptr, size_t size) ...@@ -443,6 +443,7 @@ input_curl_read(struct input_stream *is, void *ptr, size_t size)
} }
#endif #endif
do {
/* fill the buffer */ /* fill the buffer */
success = fill_buffer(is); success = fill_buffer(is);
...@@ -468,6 +469,7 @@ input_curl_read(struct input_stream *is, void *ptr, size_t size) ...@@ -468,6 +469,7 @@ input_curl_read(struct input_stream *is, void *ptr, size_t size)
nbytes += copy; nbytes += copy;
size -= copy; size -= copy;
} }
} while (nbytes == 0);
if (icy_defined(&c->icy_metadata)) if (icy_defined(&c->icy_metadata))
copy_icy_tag(c); copy_icy_tag(c);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment