[HTTP Reader] Fix reading small static files

The reader was previously returning a failure state on open if the read
completed and fit entirely into the read buffer, which broke most remote
M3U or PLS playlists.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
xcode15
Christopher Snowhill 2022-07-11 19:39:24 -07:00
parent 824675ae59
commit 7adaeb4dd0
1 changed files with 2 additions and 2 deletions

View File

@ -528,12 +528,12 @@ static void http_stream_reset(HTTPSource *fp) {
curl_slist_free_all(headers);
curl_slist_free_all(ok_aliases);
}
self->curl = NULL;
curl_easy_cleanup(curl);
[mutex lock];
if(self->status == STATUS_ABORTED) {
DLog(@"curl: thread ended due to abort signal");
self->curl = NULL;
} else {
DLog(@"curl: thread ended normally");
self->status = STATUS_FINISHED;
@ -731,7 +731,7 @@ static void http_stream_reset(HTTPSource *fp) {
- (void)close {
need_abort = YES;
content_type = nil;
while(curl != NULL) {
while(curl != NULL && status != STATUS_FINISHED) {
usleep(3000);
}
}