From fc1a226791030bcde1fe7b3fbfea019edfd53261 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Mon, 11 Jul 2022 19:39:24 -0700 Subject: [PATCH] [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 --- Plugins/HTTPSource/HTTPSource.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plugins/HTTPSource/HTTPSource.m b/Plugins/HTTPSource/HTTPSource.m index 1ba58ab9b..273a1ad25 100644 --- a/Plugins/HTTPSource/HTTPSource.m +++ b/Plugins/HTTPSource/HTTPSource.m @@ -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); } }