X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=http-fetch.c;h=dc67218ae7caba09add888bc0da165d6c0c10930;hb=5cdeae71ea7330c08cf96b581e2c7696949e3840;hp=8fd9de081fc636dc2d5010caea9686caa901c91f;hpb=aa01568dc7277f189f003ab221fec3268e5ceb81;p=git.git diff --git a/http-fetch.c b/http-fetch.c index 8fd9de08..dc67218a 100644 --- a/http-fetch.c +++ b/http-fetch.c @@ -8,6 +8,7 @@ #define RANGE_HEADER_SIZE 30 static int got_alternates = -1; +static int corrupt_object_found = 0; static struct curl_slist *no_pragma_header; @@ -468,9 +469,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; } @@ -830,6 +835,7 @@ static int fetch_object(struct alt_base *repo, unsigned char *sha1) obj_req->errorstr, obj_req->curl_result, obj_req->http_code, hex); } else if (obj_req->zret != Z_STREAM_END) { + corrupt_object_found++; ret = error("File %s (%s) corrupt", hex, obj_req->url); } else if (memcmp(obj_req->sha1, obj_req->real_sha1, 20)) { ret = error("File %s has bad hash", hex); @@ -989,5 +995,11 @@ int main(int argc, char **argv) http_cleanup(); + if (corrupt_object_found) { + fprintf(stderr, +"Some loose object were found to be corrupt, but they might be just\n" +"a false '404 Not Found' error message sent with incorrect HTTP\n" +"status code. Suggest running git fsck-objects.\n"); + } return rc; }