From fc6ae24d2c23254665ada2bb49ed233eeacb308f Mon Sep 17 00:00:00 2001 From: Jonathan Kamens Date: Fri, 29 Sep 2023 14:27:36 -0400 Subject: [PATCH] Fix broken curl HTTP response code check The check for the HTTP response code from the curl library was written incorrectly and guaranteed to always fail. I've fixed the logic to reflect what I believe was intended. --- src/link.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/link.c b/src/link.c index d636f27..c7b919d 100644 --- a/src/link.c +++ b/src/link.c @@ -1043,9 +1043,9 @@ range requests\n"); if (ret) { lprintf(error, "%s", curl_easy_strerror(ret)); } - if (!((http_resp != HTTP_OK) || - (http_resp != HTTP_PARTIAL_CONTENT) || - (http_resp != HTTP_RANGE_NOT_SATISFIABLE))) { + if ((http_resp != HTTP_OK) && + (http_resp != HTTP_PARTIAL_CONTENT) && + (http_resp != HTTP_RANGE_NOT_SATISFIABLE)) { char *url; curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &url); lprintf(warning, "Could not download %s, HTTP %ld\n", url, http_resp);