Skip to content

Commit 013c7e2

Browse files
peffgitster
authored andcommitted
http: drop support for curl < 7.16.0
In the last commit we dropped support for curl < 7.11.1, let's continue that and drop support for versions older than 7.16.0. This allows us to get rid of some now-obsolete #ifdefs. Choosing 7.16.0 is a somewhat arbitrary cutoff: 1. It came out in October of 2006, almost 15 years ago. Besides being a nice round number, around 10 years is a common end-of-life support period, even for conservative distributions. 2. That version introduced the curl_multi interface, which gives us a lot of bang for the buck in removing #ifdefs RHEL 5 came with curl 7.15.5[1] (released in August 2006). RHEL 5's extended life cycle program ended on 2020-11-30[1]. RHEL 6 comes with curl 7.19.7 (released in November 2009), and RHEL 7 comes with 7.29.0 (released in February 2013). 1. http://lore.kernel.org/git/[email protected] Signed-off-by: Jeff King <[email protected]> Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1119a15 commit 013c7e2

File tree

6 files changed

+2
-122
lines changed

6 files changed

+2
-122
lines changed

http-push.c

Lines changed: 0 additions & 23 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
}
@@ -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: 0 additions & 12 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)
@@ -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)