X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=http.c;h=14a7669cd427e101985d4acf8f3da3314937eeaa;hb=eb38cc689e84a8fd01c1856e889fe8d3b4f1bfb4;hp=eefb0f03d2f7ac30163e69b842f6943987cf9351;hpb=c8568e139ed2149fbfb7ef9a8d819d5b6b7c554f;p=git.git diff --git a/http.c b/http.c index eefb0f03..14a7669c 100644 --- a/http.c +++ b/http.c @@ -192,6 +192,9 @@ static CURL* get_curl_handle(void) curl_easy_setopt(result, CURLOPT_FOLLOWLOCATION, 1); + if (getenv("GIT_CURL_VERBOSE")) + curl_easy_setopt(result, CURLOPT_VERBOSE, 1); + return result; } @@ -417,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 */