Skip to content

Commit

Permalink
Fix broken slot reuse when fetching alternates
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nick Hengeveld authored and Junio C Hamano committed Mar 15, 2006
1 parent ea75cb7 commit c982647
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions http-fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,9 +468,13 @@ static void process_alternates_response(void *callback_data)
alt_req->url);
active_requests++;
slot->in_use = 1;
if (slot->finished != NULL)
(*slot->finished) = 0;
if (!start_active_slot(slot)) {
got_alternates = -1;
slot->in_use = 0;
if (slot->finished != NULL)
(*slot->finished) = 1;
}
return;
}
Expand Down

0 comments on commit c982647

Please sign in to comment.