Fix broken slot reuse when fetching alternates
When fetching alternates, http-fetch may reuse the slot to fetch non-http alternates if http-alternates does not exist. When doing so, it now needs to update the slot's finished status so run_active_slot waits for the non-http alternates request to finish. Signed-off-by: Nick Hengeveld <nickh@reactrix.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Nick Hengeveld committed
Mar 15, 2006 at 08:59 UTC
c982647310fc5acd0bd6ebc408e70470447b387f
1 file changed
+4
http-fetch.c
+4
@@ -468,9 +468,13 @@ static void process_alternates_response(void *callback_data)
468
alt_req->url);
469
active_requests++;
470
slot->in_use = 1;
471
+ if (slot->finished != NULL)
472
+ (*slot->finished) = 0;
473
if (!start_active_slot(slot)) {
474
got_alternates = -1;
475
slot->in_use = 0;
476
+ if (slot->finished != NULL)
477
+ (*slot->finished) = 1;
478
}
479
return;
480
}