]> git.ipfire.org Git - thirdparty/git.git/commitdiff
http: rename CURLOPT_FILE to CURLOPT_WRITEDATA
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Fri, 30 Jul 2021 17:59:46 +0000 (19:59 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 30 Jul 2021 23:01:54 +0000 (16:01 -0700)
The CURLOPT_FILE name is an alias for CURLOPT_WRITEDATA, the
CURLOPT_WRITEDATA name has been preferred since curl 7.9.7, released
in May 2002[1].

1. https://curl.se/libcurl/c/CURLOPT_WRITEDATA.html

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
http-push.c
http-walker.c
http.c
remote-curl.c

index aa3de7c1086f97ff192cc88f60a321bfc44a6842..3309aaf004a4db175bc4c0b94b5c63efebcb30e3 100644 (file)
@@ -883,7 +883,7 @@ static struct remote_lock *lock_remote(const char *path, long timeout)
        slot->results = &results;
        curl_setup_http(slot->curl, url, DAV_LOCK, &out_buffer, fwrite_buffer);
        curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, dav_headers);
-       curl_easy_setopt(slot->curl, CURLOPT_FILE, &in_buffer);
+       curl_easy_setopt(slot->curl, CURLOPT_WRITEDATA, &in_buffer);
 
        CALLOC_ARRAY(lock, 1);
        lock->timeout = -1;
@@ -1142,7 +1142,7 @@ static void remote_ls(const char *path, int flags,
        curl_setup_http(slot->curl, url, DAV_PROPFIND,
                        &out_buffer, fwrite_buffer);
        curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, dav_headers);
-       curl_easy_setopt(slot->curl, CURLOPT_FILE, &in_buffer);
+       curl_easy_setopt(slot->curl, CURLOPT_WRITEDATA, &in_buffer);
 
        if (start_active_slot(slot)) {
                run_active_slot(slot);
@@ -1216,7 +1216,7 @@ static int locking_available(void)
        curl_setup_http(slot->curl, repo->url, DAV_PROPFIND,
                        &out_buffer, fwrite_buffer);
        curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, dav_headers);
-       curl_easy_setopt(slot->curl, CURLOPT_FILE, &in_buffer);
+       curl_easy_setopt(slot->curl, CURLOPT_WRITEDATA, &in_buffer);
 
        if (start_active_slot(slot)) {
                run_active_slot(slot);
index 19e31623f04e8e24dd58992c69b75fb1a835d5af..910fae539b89e6aea2af299b61dd64ff645b3578 100644 (file)
@@ -378,7 +378,7 @@ static void fetch_alternates(struct walker *walker, const char *base)
        alt_req.walker = walker;
        slot->callback_data = &alt_req;
 
-       curl_easy_setopt(slot->curl, CURLOPT_FILE, &buffer);
+       curl_easy_setopt(slot->curl, CURLOPT_WRITEDATA, &buffer);
        curl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION, fwrite_buffer);
        curl_easy_setopt(slot->curl, CURLOPT_URL, url.buf);
 
diff --git a/http.c b/http.c
index e9446850a6275a2139f7fabc6f2b6a7a77720102..a0f169d2fe535643617aa10fa2e92a65d6b04ab0 100644 (file)
--- a/http.c
+++ b/http.c
@@ -1769,7 +1769,7 @@ static int http_request(const char *url,
                curl_easy_setopt(slot->curl, CURLOPT_NOBODY, 1);
        } else {
                curl_easy_setopt(slot->curl, CURLOPT_NOBODY, 0);
-               curl_easy_setopt(slot->curl, CURLOPT_FILE, result);
+               curl_easy_setopt(slot->curl, CURLOPT_WRITEDATA, result);
 
                if (target == HTTP_REQUEST_FILE) {
                        off_t posn = ftello(result);
@@ -2186,7 +2186,7 @@ struct http_pack_request *new_direct_http_pack_request(
        }
 
        preq->slot = get_active_slot();
-       curl_easy_setopt(preq->slot->curl, CURLOPT_FILE, preq->packfile);
+       curl_easy_setopt(preq->slot->curl, CURLOPT_WRITEDATA, preq->packfile);
        curl_easy_setopt(preq->slot->curl, CURLOPT_WRITEFUNCTION, fwrite);
        curl_easy_setopt(preq->slot->curl, CURLOPT_URL, preq->url);
        curl_easy_setopt(preq->slot->curl, CURLOPT_HTTPHEADER,
@@ -2357,7 +2357,7 @@ struct http_object_request *new_http_object_request(const char *base_url,
 
        freq->slot = get_active_slot();
 
-       curl_easy_setopt(freq->slot->curl, CURLOPT_FILE, freq);
+       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_WRITEFUNCTION, fwrite_sha1_file);
        curl_easy_setopt(freq->slot->curl, CURLOPT_ERRORBUFFER, freq->errorstr);
index 482d5a4656db4bd9c37e08cc6319cbbcada7b2f0..bf795f90c6e6743b924a0f61996ebc3c79e79bee 100644 (file)
@@ -853,7 +853,7 @@ static int probe_rpc(struct rpc_state *rpc, struct slot_results *results)
        curl_easy_setopt(slot->curl, CURLOPT_POSTFIELDSIZE, 4);
        curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, headers);
        curl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION, fwrite_buffer);
-       curl_easy_setopt(slot->curl, CURLOPT_FILE, &buf);
+       curl_easy_setopt(slot->curl, CURLOPT_WRITEDATA, &buf);
 
        err = run_slot(slot, results);
 
@@ -1016,7 +1016,7 @@ retry:
        rpc_in_data.slot = slot;
        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_FILE, &rpc_in_data);
+       curl_easy_setopt(slot->curl, CURLOPT_WRITEDATA, &rpc_in_data);
        curl_easy_setopt(slot->curl, CURLOPT_FAILONERROR, 0);