summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e99fcf9)
raw | patch | inline | side by side (parent: e99fcf9)
author | Nick Hengeveld <nickh@reactrix.com> | |
Thu, 22 Dec 2005 17:09:05 +0000 (09:09 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 22 Dec 2005 20:52:35 +0000 (12:52 -0800) |
Recognize missing files when using http-fetch with file:// URLs
Signed-off-by: Nick Hengeveld <nickh@reactrix.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Nick Hengeveld <nickh@reactrix.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
http-fetch.c | patch | blob | history |
diff --git a/http-fetch.c b/http-fetch.c
index 3cd6ef91af59fdb42a664cb8d9bdb5b591ecb789..61b2188adbb68d94b2d5906be63c89bda879b4b0 100644 (file)
--- a/http-fetch.c
+++ b/http-fetch.c
obj_req->state = COMPLETE;
/* Use alternates if necessary */
- if (obj_req->http_code == 404) {
+ if (obj_req->http_code == 404 ||
+ obj_req->curl_result == CURLE_FILE_COULDNT_READ_FILE) {
fetch_alternates(alt->base);
if (obj_req->repo->next != NULL) {
obj_req->repo =
}
}
} else if (slot->curl_result != CURLE_OK) {
- if (slot->http_code != 404) {
+ if (slot->http_code != 404 &&
+ slot->curl_result != CURLE_FILE_COULDNT_READ_FILE) {
got_alternates = -1;
return;
}
if (start_active_slot(slot)) {
run_active_slot(slot);
if (slot->curl_result != CURLE_OK) {
- if (slot->http_code == 404) {
+ if (slot->http_code == 404 ||
+ slot->curl_result == CURLE_FILE_COULDNT_READ_FILE) {
repo->got_indices = 1;
free(buffer.buffer);
return 0;
ret = error("Request for %s aborted", hex);
} else if (obj_req->curl_result != CURLE_OK &&
obj_req->http_code != 416) {
- if (obj_req->http_code == 404)
+ if (obj_req->http_code == 404 ||
+ obj_req->curl_result == CURLE_FILE_COULDNT_READ_FILE)
ret = -1; /* Be silent, it is probably in a pack. */
else
ret = error("%s (curl_result = %d, http_code = %ld, sha1 = %s)",