X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=http.c;h=14a7669cd427e101985d4acf8f3da3314937eeaa;hb=53f313897e37f25e1411a6a7cfa328d642847345;hp=632c2c5c2fcf2ef51092aa72d8c2dee64efbde49;hpb=66f04f38f42024dceb1679fc4d672de3746cf237;p=git.git diff --git a/http.c b/http.c index 632c2c5c..14a7669c 100644 --- a/http.c +++ b/http.c @@ -420,10 +420,26 @@ void run_active_slot(struct active_request_slot *slot) #endif } -static void finish_active_slot(struct active_request_slot *slot) +static void closedown_active_slot(struct active_request_slot *slot) { active_requests--; slot->in_use = 0; +} + +void release_active_slot(struct active_request_slot *slot) +{ + closedown_active_slot(slot); + if (slot->curl) { + curl_multi_remove_handle(curlm, slot->curl); + curl_easy_cleanup(slot->curl); + slot->curl = NULL; + } + fill_active_slots(); +} + +static void finish_active_slot(struct active_request_slot *slot) +{ + closedown_active_slot(slot); curl_easy_getinfo(slot->curl, CURLINFO_HTTP_CODE, &slot->http_code); /* Store slot results so they can be read after the slot is reused */