Fix for cURL >7.69

Found on conda-forge (which is now running 7.71.1), that byte-range
requests would stall. It turns out this is due to
CURLOPT_NOBODY--apparently setting this to 0 disables the HEAD request,
but does not restore downloading the body. The way to fix this is to
reset to CURLOPT_HTTPGET when done with a HEAD request.
This commit is contained in:
Ryan May 2020-07-22 02:19:43 -06:00
parent cee0a9332d
commit 6ea54a76ed
No known key found for this signature in database
GPG Key ID: 33BF97C62E8ACC62

View File

@ -377,7 +377,7 @@ execute(NC_HTTP_STATE* state, int headcmd)
if(cstat != CURLE_OK) state->httpcode = 0;
if(headcmd) {
cstat = CURLERR(curl_easy_setopt(state->curl, CURLOPT_NOBODY, 0L));
cstat = CURLERR(curl_easy_setopt(state->curl, CURLOPT_HTTPGET, 1L));
if(cstat != CURLE_OK) goto fail;
}