diff options
author | Mark Wooding <mdw@distorted.org.uk> | 2006-02-07 11:07:39 +0100 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-02-07 11:13:02 +0100 |
commit | 53f313897e37f25e1411a6a7cfa328d642847345 (patch) | |
tree | 9e4832af9cef9d576af7cd67fe51d54f9662b761 /http.c | |
parent | format-patch: Remove last vestiges of --mbox option (diff) | |
download | git-53f313897e37f25e1411a6a7cfa328d642847345.tar.xz git-53f313897e37f25e1411a6a7cfa328d642847345.zip |
http-fetch: Abort requests for objects which arrived in packs
In fetch_object, there's a call to release an object request if the
object mysteriously arrived, say in a pack. Unfortunately, the fetch
attempt for this object might already be in progress, and we'll leak the
descriptor. Instead, try to tidy away the request.
Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'http.c')
-rw-r--r-- | http.c | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -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 */ |