diff options
Diffstat (limited to 'http-fetch.c')
-rw-r--r-- | http-fetch.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/http-fetch.c b/http-fetch.c index 202fae0ba8..e9b9f307f8 100644 --- a/http-fetch.c +++ b/http-fetch.c @@ -317,30 +317,21 @@ static void release_object_request(struct object_request *obj_req) } #ifdef USE_CURL_MULTI -void fill_active_slots(void) +int fill_active_slot(void) { - struct object_request *obj_req = object_queue_head; - struct active_request_slot *slot = active_queue_head; - int num_transfers; + struct object_request *obj_req; - while (active_requests < max_requests && obj_req != NULL) { + for (obj_req = object_queue_head; obj_req; obj_req = obj_req->next) { if (obj_req->state == WAITING) { if (has_sha1_file(obj_req->sha1)) obj_req->state = COMPLETE; - else + else { start_object_request(obj_req); - curl_multi_perform(curlm, &num_transfers); - } - obj_req = obj_req->next; - } - - while (slot != NULL) { - if (!slot->in_use && slot->curl != NULL) { - curl_easy_cleanup(slot->curl); - slot->curl = NULL; + return 1; + } } - slot = slot->next; } + return 0; } #endif |