summaryrefslogtreecommitdiff
path: root/http.c
diff options
context:
space:
mode:
authorMike Hommey <mh@glandium.org>2008-03-03 20:30:16 +0100
committerJunio C Hamano <gitster@pobox.com>2008-03-03 13:36:44 -0800
commitf23d1f76273a59b030ea1028016e6a9fc9679d2c (patch)
tree7d25ad6dddbcf1bacf6668db85ac365d7ae040da /http.c
parentd3df4271b900c9bf529cf495afeb77fbbf621221 (diff)
downloadgit-f23d1f76273a59b030ea1028016e6a9fc9679d2c.tar.gz
Fix random crashes in http_cleanup()
For some reason, http_cleanup was running all active slots, which could lead in situations where a freed slot would be accessed in fill_active_slots. OTOH, we are cleaning up, which means the caller doesn't care about pending requests. Just forget about them instead or running them. Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'http.c')
-rw-r--r--http.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/http.c b/http.c
index 5925d07478..c7deccb6de 100644
--- a/http.c
+++ b/http.c
@@ -281,23 +281,15 @@ void http_init(void)
void http_cleanup(void)
{
struct active_request_slot *slot = active_queue_head;
-#ifdef USE_CURL_MULTI
- char *wait_url;
-#endif
while (slot != NULL) {
struct active_request_slot *next = slot->next;
+ if (slot->curl != NULL) {
#ifdef USE_CURL_MULTI
- if (slot->in_use) {
- curl_easy_getinfo(slot->curl,
- CURLINFO_EFFECTIVE_URL,
- &wait_url);
- fprintf(stderr, "Waiting for %s\n", wait_url);
- run_active_slot(slot);
- }
+ curl_multi_remove_handle(curlm, slot->curl);
#endif
- if (slot->curl != NULL)
curl_easy_cleanup(slot->curl);
+ }
free(slot);
slot = next;
}