summaryrefslogtreecommitdiff
path: root/http-fetch.c
diff options
context:
space:
mode:
authorNick Hengeveld <nickh@reactrix.com>2005-11-18 19:03:11 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-11-20 04:17:24 (GMT)
commit5e3a769186bc41f94c1970579f96f3b68b046ed6 (patch)
tree00e6b594e9e42113873939a5fd802a466cf8419a /http-fetch.c
parente388ab74dbaea5cdbf07b175be8d6980579392f4 (diff)
downloadgit-5e3a769186bc41f94c1970579f96f3b68b046ed6.zip
git-5e3a769186bc41f94c1970579f96f3b68b046ed6.tar.gz
git-5e3a769186bc41f94c1970579f96f3b68b046ed6.tar.bz2
Improve pack list response handling
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>
Diffstat (limited to 'http-fetch.c')
-rw-r--r--http-fetch.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/http-fetch.c b/http-fetch.c
index 53a7dbf..4353173 100644
--- a/http-fetch.c
+++ b/http-fetch.c
@@ -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");
}