Skip to content

Commit

Permalink
Improve pack list response handling
Browse files Browse the repository at this point in the history
Better response handling for pack list requests - a 404 means we do have
the list but it happens to be empty.

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 Nov 20, 2005
1 parent e388ab7 commit 5e3a769
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions http-fetch.c
Expand Up @@ -637,10 +637,18 @@ static int fetch_indices(struct alt_base *repo)
if (start_active_slot(slot)) {
run_active_slot(slot);
if (slot->curl_result != CURLE_OK) {
free(buffer.buffer);
return error("%s", curl_errorstr);
if (slot->http_code == 404) {
repo->got_indices = 1;
free(buffer.buffer);
return 0;
} else {
repo->got_indices = 0;
free(buffer.buffer);
return error("%s", curl_errorstr);
}
}
} else {
repo->got_indices = 0;
free(buffer.buffer);
return error("Unable to start request");
}
Expand Down

0 comments on commit 5e3a769

Please sign in to comment.