Merge branch 'js/curl-easy-setopt-typefix'

Adjust to newer version of libcURL.

* js/curl-easy-setopt-typefix:
  curl: pass `long` values where expected
maint
Junio C Hamano 2025-06-07 10:46:50 -07:00
commit 8546b3566e
3 changed files with 17 additions and 17 deletions

View File

@ -205,7 +205,7 @@ static void curl_setup_http(CURL *curl, const char *url,
const char *custom_req, struct buffer *buffer,
curl_write_callback write_fn)
{
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1);
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_INFILE, buffer);
curl_easy_setopt(curl, CURLOPT_INFILESIZE, buffer->buf.len);
@ -213,9 +213,9 @@ static void curl_setup_http(CURL *curl, const char *url,
curl_easy_setopt(curl, CURLOPT_SEEKFUNCTION, seek_buffer);
curl_easy_setopt(curl, CURLOPT_SEEKDATA, buffer);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_fn);
curl_easy_setopt(curl, CURLOPT_NOBODY, 0);
curl_easy_setopt(curl, CURLOPT_NOBODY, 0L);
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, custom_req);
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1);
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
}

static struct curl_slist *get_dav_token_headers(struct remote_lock *lock, enum dav_header_flag options)

22
http.c
View File

@ -1540,9 +1540,9 @@ struct active_request_slot *get_active_slot(void)
curl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION, NULL);
curl_easy_setopt(slot->curl, CURLOPT_POSTFIELDS, NULL);
curl_easy_setopt(slot->curl, CURLOPT_POSTFIELDSIZE, -1L);
curl_easy_setopt(slot->curl, CURLOPT_UPLOAD, 0);
curl_easy_setopt(slot->curl, CURLOPT_HTTPGET, 1);
curl_easy_setopt(slot->curl, CURLOPT_FAILONERROR, 1);
curl_easy_setopt(slot->curl, CURLOPT_UPLOAD, 0L);
curl_easy_setopt(slot->curl, CURLOPT_HTTPGET, 1L);
curl_easy_setopt(slot->curl, CURLOPT_FAILONERROR, 1L);
curl_easy_setopt(slot->curl, CURLOPT_RANGE, NULL);

/*
@ -1551,9 +1551,9 @@ struct active_request_slot *get_active_slot(void)
* HTTP_FOLLOW_* cases themselves.
*/
if (http_follow_config == HTTP_FOLLOW_ALWAYS)
curl_easy_setopt(slot->curl, CURLOPT_FOLLOWLOCATION, 1);
curl_easy_setopt(slot->curl, CURLOPT_FOLLOWLOCATION, 1L);
else
curl_easy_setopt(slot->curl, CURLOPT_FOLLOWLOCATION, 0);
curl_easy_setopt(slot->curl, CURLOPT_FOLLOWLOCATION, 0L);

curl_easy_setopt(slot->curl, CURLOPT_IPRESOLVE, git_curl_ipresolve);
curl_easy_setopt(slot->curl, CURLOPT_HTTPAUTH, http_auth_methods);
@ -2120,12 +2120,12 @@ static int http_request(const char *url,
int ret;

slot = get_active_slot();
curl_easy_setopt(slot->curl, CURLOPT_HTTPGET, 1);
curl_easy_setopt(slot->curl, CURLOPT_HTTPGET, 1L);

if (!result) {
curl_easy_setopt(slot->curl, CURLOPT_NOBODY, 1);
curl_easy_setopt(slot->curl, CURLOPT_NOBODY, 1L);
} else {
curl_easy_setopt(slot->curl, CURLOPT_NOBODY, 0);
curl_easy_setopt(slot->curl, CURLOPT_NOBODY, 0L);
curl_easy_setopt(slot->curl, CURLOPT_WRITEDATA, result);

if (target == HTTP_REQUEST_FILE) {
@ -2151,7 +2151,7 @@ static int http_request(const char *url,
strbuf_addstr(&buf, " no-cache");
if (options && options->initial_request &&
http_follow_config == HTTP_FOLLOW_INITIAL)
curl_easy_setopt(slot->curl, CURLOPT_FOLLOWLOCATION, 1);
curl_easy_setopt(slot->curl, CURLOPT_FOLLOWLOCATION, 1L);

headers = curl_slist_append(headers, buf.buf);

@ -2170,7 +2170,7 @@ static int http_request(const char *url,
curl_easy_setopt(slot->curl, CURLOPT_URL, url);
curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(slot->curl, CURLOPT_ENCODING, "");
curl_easy_setopt(slot->curl, CURLOPT_FAILONERROR, 0);
curl_easy_setopt(slot->curl, CURLOPT_FAILONERROR, 0L);

ret = run_one_slot(slot, &results);

@ -2750,7 +2750,7 @@ struct http_object_request *new_http_object_request(const char *base_url,
freq->headers = object_request_headers();

curl_easy_setopt(freq->slot->curl, CURLOPT_WRITEDATA, freq);
curl_easy_setopt(freq->slot->curl, CURLOPT_FAILONERROR, 0);
curl_easy_setopt(freq->slot->curl, CURLOPT_FAILONERROR, 0L);
curl_easy_setopt(freq->slot->curl, CURLOPT_WRITEFUNCTION, fwrite_sha1_file);
curl_easy_setopt(freq->slot->curl, CURLOPT_ERRORBUFFER, freq->errorstr);
curl_easy_setopt(freq->slot->curl, CURLOPT_URL, freq->url);

View File

@ -970,8 +970,8 @@ retry:

slot = get_active_slot();

curl_easy_setopt(slot->curl, CURLOPT_NOBODY, 0);
curl_easy_setopt(slot->curl, CURLOPT_POST, 1);
curl_easy_setopt(slot->curl, CURLOPT_NOBODY, 0L);
curl_easy_setopt(slot->curl, CURLOPT_POST, 1L);
curl_easy_setopt(slot->curl, CURLOPT_URL, rpc->service_url);
curl_easy_setopt(slot->curl, CURLOPT_ENCODING, "");

@ -1058,7 +1058,7 @@ retry:
rpc_in_data.check_pktline = stateless_connect;
memset(&rpc_in_data.pktline_state, 0, sizeof(rpc_in_data.pktline_state));
curl_easy_setopt(slot->curl, CURLOPT_WRITEDATA, &rpc_in_data);
curl_easy_setopt(slot->curl, CURLOPT_FAILONERROR, 0);
curl_easy_setopt(slot->curl, CURLOPT_FAILONERROR, 0L);


rpc->any_written = 0;