Skip to content

Commit 8dda4cb

Browse files
avargitster
authored andcommitted
http: rename CURLOPT_FILE to CURLOPT_WRITEDATA
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5db9d38 commit 8dda4cb

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

http-push.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ static struct remote_lock *lock_remote(const char *path, long timeout)
883883
slot->results = &results;
884884
curl_setup_http(slot->curl, url, DAV_LOCK, &out_buffer, fwrite_buffer);
885885
curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, dav_headers);
886-
curl_easy_setopt(slot->curl, CURLOPT_FILE, &in_buffer);
886+
curl_easy_setopt(slot->curl, CURLOPT_WRITEDATA, &in_buffer);
887887

888888
CALLOC_ARRAY(lock, 1);
889889
lock->timeout = -1;
@@ -1142,7 +1142,7 @@ static void remote_ls(const char *path, int flags,
11421142
curl_setup_http(slot->curl, url, DAV_PROPFIND,
11431143
&out_buffer, fwrite_buffer);
11441144
curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, dav_headers);
1145-
curl_easy_setopt(slot->curl, CURLOPT_FILE, &in_buffer);
1145+
curl_easy_setopt(slot->curl, CURLOPT_WRITEDATA, &in_buffer);
11461146

11471147
if (start_active_slot(slot)) {
11481148
run_active_slot(slot);
@@ -1216,7 +1216,7 @@ static int locking_available(void)
12161216
curl_setup_http(slot->curl, repo->url, DAV_PROPFIND,
12171217
&out_buffer, fwrite_buffer);
12181218
curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, dav_headers);
1219-
curl_easy_setopt(slot->curl, CURLOPT_FILE, &in_buffer);
1219+
curl_easy_setopt(slot->curl, CURLOPT_WRITEDATA, &in_buffer);
12201220

12211221
if (start_active_slot(slot)) {
12221222
run_active_slot(slot);

http-walker.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ static void fetch_alternates(struct walker *walker, const char *base)
378378
alt_req.walker = walker;
379379
slot->callback_data = &alt_req;
380380

381-
curl_easy_setopt(slot->curl, CURLOPT_FILE, &buffer);
381+
curl_easy_setopt(slot->curl, CURLOPT_WRITEDATA, &buffer);
382382
curl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION, fwrite_buffer);
383383
curl_easy_setopt(slot->curl, CURLOPT_URL, url.buf);
384384

http.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1769,7 +1769,7 @@ static int http_request(const char *url,
17691769
curl_easy_setopt(slot->curl, CURLOPT_NOBODY, 1);
17701770
} else {
17711771
curl_easy_setopt(slot->curl, CURLOPT_NOBODY, 0);
1772-
curl_easy_setopt(slot->curl, CURLOPT_FILE, result);
1772+
curl_easy_setopt(slot->curl, CURLOPT_WRITEDATA, result);
17731773

17741774
if (target == HTTP_REQUEST_FILE) {
17751775
off_t posn = ftello(result);
@@ -2186,7 +2186,7 @@ struct http_pack_request *new_direct_http_pack_request(
21862186
}
21872187

21882188
preq->slot = get_active_slot();
2189-
curl_easy_setopt(preq->slot->curl, CURLOPT_FILE, preq->packfile);
2189+
curl_easy_setopt(preq->slot->curl, CURLOPT_WRITEDATA, preq->packfile);
21902190
curl_easy_setopt(preq->slot->curl, CURLOPT_WRITEFUNCTION, fwrite);
21912191
curl_easy_setopt(preq->slot->curl, CURLOPT_URL, preq->url);
21922192
curl_easy_setopt(preq->slot->curl, CURLOPT_HTTPHEADER,
@@ -2357,7 +2357,7 @@ struct http_object_request *new_http_object_request(const char *base_url,
23572357

23582358
freq->slot = get_active_slot();
23592359

2360-
curl_easy_setopt(freq->slot->curl, CURLOPT_FILE, freq);
2360+
curl_easy_setopt(freq->slot->curl, CURLOPT_WRITEDATA, freq);
23612361
curl_easy_setopt(freq->slot->curl, CURLOPT_FAILONERROR, 0);
23622362
curl_easy_setopt(freq->slot->curl, CURLOPT_WRITEFUNCTION, fwrite_sha1_file);
23632363
curl_easy_setopt(freq->slot->curl, CURLOPT_ERRORBUFFER, freq->errorstr);

remote-curl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ static int probe_rpc(struct rpc_state *rpc, struct slot_results *results)
853853
curl_easy_setopt(slot->curl, CURLOPT_POSTFIELDSIZE, 4);
854854
curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, headers);
855855
curl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION, fwrite_buffer);
856-
curl_easy_setopt(slot->curl, CURLOPT_FILE, &buf);
856+
curl_easy_setopt(slot->curl, CURLOPT_WRITEDATA, &buf);
857857

858858
err = run_slot(slot, results);
859859

@@ -1016,7 +1016,7 @@ static int post_rpc(struct rpc_state *rpc, int stateless_connect, int flush_rece
10161016
rpc_in_data.slot = slot;
10171017
rpc_in_data.check_pktline = stateless_connect;
10181018
memset(&rpc_in_data.pktline_state, 0, sizeof(rpc_in_data.pktline_state));
1019-
curl_easy_setopt(slot->curl, CURLOPT_FILE, &rpc_in_data);
1019+
curl_easy_setopt(slot->curl, CURLOPT_WRITEDATA, &rpc_in_data);
10201020
curl_easy_setopt(slot->curl, CURLOPT_FAILONERROR, 0);
10211021

10221022

0 commit comments

Comments
 (0)