Skip to content

Commit e48a623

Browse files
committed
Merge branch 'ab/http-drop-old-curl'
Support for ancient versions of cURL library (pre 7.19.4) has been dropped. * ab/http-drop-old-curl: http: rename CURLOPT_FILE to CURLOPT_WRITEDATA http: drop support for curl < 7.19.3 and < 7.17.0 (again) http: drop support for curl < 7.19.4 http: drop support for curl < 7.16.0 http: drop support for curl < 7.11.1
2 parents 2f71366 + 8dda4cb commit e48a623

File tree

6 files changed

+10
-263
lines changed

6 files changed

+10
-263
lines changed

http-push.c

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,8 @@ static void curl_setup_http(CURL *curl, const char *url,
203203
curl_easy_setopt(curl, CURLOPT_INFILE, buffer);
204204
curl_easy_setopt(curl, CURLOPT_INFILESIZE, buffer->buf.len);
205205
curl_easy_setopt(curl, CURLOPT_READFUNCTION, fread_buffer);
206-
#ifndef NO_CURL_IOCTL
207206
curl_easy_setopt(curl, CURLOPT_IOCTLFUNCTION, ioctl_buffer);
208207
curl_easy_setopt(curl, CURLOPT_IOCTLDATA, buffer);
209-
#endif
210208
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_fn);
211209
curl_easy_setopt(curl, CURLOPT_NOBODY, 0);
212210
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, custom_req);
@@ -249,8 +247,6 @@ static void process_response(void *callback_data)
249247
finish_request(request);
250248
}
251249

252-
#ifdef USE_CURL_MULTI
253-
254250
static void start_fetch_loose(struct transfer_request *request)
255251
{
256252
struct active_request_slot *slot;
@@ -299,7 +295,6 @@ static void start_mkcol(struct transfer_request *request)
299295
FREE_AND_NULL(request->url);
300296
}
301297
}
302-
#endif
303298

304299
static void start_fetch_packed(struct transfer_request *request)
305300
{
@@ -605,7 +600,6 @@ static void finish_request(struct transfer_request *request)
605600
}
606601
}
607602

608-
#ifdef USE_CURL_MULTI
609603
static int is_running_queue;
610604
static int fill_active_slot(void *unused)
611605
{
@@ -629,7 +623,6 @@ static int fill_active_slot(void *unused)
629623
}
630624
return 0;
631625
}
632-
#endif
633626

634627
static void get_remote_object_list(unsigned char parent);
635628

@@ -658,10 +651,8 @@ static void add_fetch_request(struct object *obj)
658651
request->next = request_queue_head;
659652
request_queue_head = request;
660653

661-
#ifdef USE_CURL_MULTI
662654
fill_active_slots();
663655
step_active_slots();
664-
#endif
665656
}
666657

667658
static int add_send_request(struct object *obj, struct remote_lock *lock)
@@ -696,10 +687,8 @@ static int add_send_request(struct object *obj, struct remote_lock *lock)
696687
request->next = request_queue_head;
697688
request_queue_head = request;
698689

699-
#ifdef USE_CURL_MULTI
700690
fill_active_slots();
701691
step_active_slots();
702-
#endif
703692

704693
return 1;
705694
}
@@ -894,7 +883,7 @@ static struct remote_lock *lock_remote(const char *path, long timeout)
894883
slot->results = &results;
895884
curl_setup_http(slot->curl, url, DAV_LOCK, &out_buffer, fwrite_buffer);
896885
curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, dav_headers);
897-
curl_easy_setopt(slot->curl, CURLOPT_FILE, &in_buffer);
886+
curl_easy_setopt(slot->curl, CURLOPT_WRITEDATA, &in_buffer);
898887

899888
CALLOC_ARRAY(lock, 1);
900889
lock->timeout = -1;
@@ -1153,7 +1142,7 @@ static void remote_ls(const char *path, int flags,
11531142
curl_setup_http(slot->curl, url, DAV_PROPFIND,
11541143
&out_buffer, fwrite_buffer);
11551144
curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, dav_headers);
1156-
curl_easy_setopt(slot->curl, CURLOPT_FILE, &in_buffer);
1145+
curl_easy_setopt(slot->curl, CURLOPT_WRITEDATA, &in_buffer);
11571146

11581147
if (start_active_slot(slot)) {
11591148
run_active_slot(slot);
@@ -1227,7 +1216,7 @@ static int locking_available(void)
12271216
curl_setup_http(slot->curl, repo->url, DAV_PROPFIND,
12281217
&out_buffer, fwrite_buffer);
12291218
curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, dav_headers);
1230-
curl_easy_setopt(slot->curl, CURLOPT_FILE, &in_buffer);
1219+
curl_easy_setopt(slot->curl, CURLOPT_WRITEDATA, &in_buffer);
12311220

12321221
if (start_active_slot(slot)) {
12331222
run_active_slot(slot);
@@ -1682,21 +1671,15 @@ static int delete_remote_branch(const char *pattern, int force)
16821671

16831672
static void run_request_queue(void)
16841673
{
1685-
#ifdef USE_CURL_MULTI
16861674
is_running_queue = 1;
16871675
fill_active_slots();
16881676
add_fill_function(NULL, fill_active_slot);
1689-
#endif
16901677
do {
16911678
finish_all_active_slots();
1692-
#ifdef USE_CURL_MULTI
16931679
fill_active_slots();
1694-
#endif
16951680
} while (request_queue_head && !aborted);
16961681

1697-
#ifdef USE_CURL_MULTI
16981682
is_running_queue = 0;
1699-
#endif
17001683
}
17011684

17021685
int cmd_main(int argc, const char **argv)
@@ -1770,10 +1753,6 @@ int cmd_main(int argc, const char **argv)
17701753
break;
17711754
}
17721755

1773-
#ifndef USE_CURL_MULTI
1774-
die("git-push is not available for http/https repository when not compiled with USE_CURL_MULTI");
1775-
#endif
1776-
17771756
if (!repo->url)
17781757
usage(http_push_usage);
17791758

@@ -1786,9 +1765,7 @@ int cmd_main(int argc, const char **argv)
17861765

17871766
http_init(NULL, repo->url, 1);
17881767

1789-
#ifdef USE_CURL_MULTI
17901768
is_running_queue = 0;
1791-
#endif
17921769

17931770
/* Verify DAV compliance/lock support */
17941771
if (!locking_available()) {

http-walker.c

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ static void release_object_request(struct object_request *obj_req)
127127
free(obj_req);
128128
}
129129

130-
#ifdef USE_CURL_MULTI
131130
static int fill_active_slot(struct walker *walker)
132131
{
133132
struct object_request *obj_req;
@@ -146,7 +145,6 @@ static int fill_active_slot(struct walker *walker)
146145
}
147146
return 0;
148147
}
149-
#endif
150148

151149
static void prefetch(struct walker *walker, unsigned char *sha1)
152150
{
@@ -163,10 +161,8 @@ static void prefetch(struct walker *walker, unsigned char *sha1)
163161
http_is_verbose = walker->get_verbosely;
164162
list_add_tail(&newreq->node, &object_queue_head);
165163

166-
#ifdef USE_CURL_MULTI
167164
fill_active_slots();
168165
step_active_slots();
169-
#endif
170166
}
171167

172168
static int is_alternate_allowed(const char *url)
@@ -357,11 +353,9 @@ static void fetch_alternates(struct walker *walker, const char *base)
357353
* wait for them to arrive and return to processing this request's
358354
* curl message
359355
*/
360-
#ifdef USE_CURL_MULTI
361356
while (cdata->got_alternates == 0) {
362357
step_active_slots();
363358
}
364-
#endif
365359

366360
/* Nothing to do if they've already been fetched */
367361
if (cdata->got_alternates == 1)
@@ -384,7 +378,7 @@ static void fetch_alternates(struct walker *walker, const char *base)
384378
alt_req.walker = walker;
385379
slot->callback_data = &alt_req;
386380

387-
curl_easy_setopt(slot->curl, CURLOPT_FILE, &buffer);
381+
curl_easy_setopt(slot->curl, CURLOPT_WRITEDATA, &buffer);
388382
curl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION, fwrite_buffer);
389383
curl_easy_setopt(slot->curl, CURLOPT_URL, url.buf);
390384

@@ -505,12 +499,8 @@ static int fetch_object(struct walker *walker, unsigned char *hash)
505499
return 0;
506500
}
507501

508-
#ifdef USE_CURL_MULTI
509502
while (obj_req->state == WAITING)
510503
step_active_slots();
511-
#else
512-
start_object_request(walker, obj_req);
513-
#endif
514504

515505
/*
516506
* obj_req->req might change when fetching alternates in the callback
@@ -623,9 +613,7 @@ struct walker *get_http_walker(const char *url)
623613
walker->cleanup = cleanup;
624614
walker->data = data;
625615

626-
#ifdef USE_CURL_MULTI
627616
add_fill_function(walker, (int (*)(void *)) fill_active_slot);
628-
#endif
629617

630618
return walker;
631619
}

0 commit comments

Comments
 (0)