playlist/preparser: cancellation leads to partial art download
If the thread responsible for fetching art is cancelled while art is still being downloaded, the cache will be populated with an entry containing partial content.
An easy way to reproduce the issue is by doing something as the below:
% cat /tmp/foo.m3u
#EXTM3U
#EXTALBUMARTURL:http://localhost:1337/korv.png
file:///tmp/sample_1.mp3
% echo -e \
> "HTTP/1.0 200 OK\r\n"\
> "Content-Type: image/png\r\n"\
> "Content-Length: 1337\r\n"\
> "\r\n"\
> "this is spaa-" | nc -l -p 1337
Then:
- Play
/tmp/foo.m3u
- Notice that VLC tries to download the art from our fake httpd
- Close VLC