@matheusbsbs / matheus-bagliano / commits / 5e3a769186
Fork 0

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>

Nick Hengeveld committed Nov 18, 2005 at 11:03 UTC 5e3a769186bc41f94c1970579f96f3b68b046ed6
1 file changed +10 -2
http-fetch.c
+10 -2
@@ -637,10 +637,18 @@ static int fetch_indices(struct alt_base *repo)
637 if (start_active_slot(slot)) {
638 run_active_slot(slot);
639 if (slot->curl_result != CURLE_OK) {
640 - free(buffer.buffer);
641 - return error("%s", curl_errorstr);
640 + if (slot->http_code == 404) {
641 + repo->got_indices = 1;
642 + free(buffer.buffer);
643 + return 0;
644 + } else {
645 + repo->got_indices = 0;
646 + free(buffer.buffer);
647 + return error("%s", curl_errorstr);
648 + }
649 }
650 } else {
651 + repo->got_indices = 0;
652 free(buffer.buffer);
653 return error("Unable to start request");
654 }