diff options
author | Xavier Roche <xroche@users.noreply.github.com> | 2013-04-14 10:02:13 +0000 |
---|---|---|
committer | Xavier Roche <xroche@users.noreply.github.com> | 2013-04-14 10:02:13 +0000 |
commit | fe7e71e751afae06dc0ad1c62d536e2a4278ca17 (patch) | |
tree | e90b38997664b0de591003981e8538d327a54dbf | |
parent | efa69be688b62ebe3671d9e5d5cd5ade5a203a7e (diff) |
Do not report "broken file" message for incomplete files.
-rw-r--r-- | src/htsback.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/htsback.c b/src/htsback.c index bd92555..5a6ef2e 100644 --- a/src/htsback.c +++ b/src/htsback.c @@ -456,14 +456,16 @@ int back_finalize(httrackp* opt,cache_back* cache,struct_back* sback,int p) { if (!back[p].finalized) { back[p].finalized = 1; - /* Don't store broken files */ - if (back[p].r.totalsize > 0 && back[p].r.size != back[p].r.totalsize && ! opt->tolerant) { + /* Don't store broken files */ + if (back[p].status == STATUS_READY && back[p].r.totalsize > 0 && back[p].r.size != back[p].r.totalsize && ! opt->tolerant) { if (opt->log!=NULL) { - HTS_LOG(opt,LOG_WARNING); fprintf(opt->log,"file not stored in cache due to bogus state (broken size): %s%s"LF,back[p].url_adr,back[p].url_fil); + HTS_LOG(opt,LOG_WARNING); + fprintf(opt->log, "file not stored in cache due to bogus state (broken size, expected %d got %d): %s%s"LF, + back[p].r.totalsize, back[p].r.size, back[p].url_adr,back[p].url_fil); } test_flush; - return -1; - } + return -1; + } if ( (back[p].status == STATUS_READY) // ready @@ -561,7 +563,6 @@ int back_finalize(httrackp* opt,cache_back* cache,struct_back* sback,int p) { } } #endif - /* Write mode to disk */ if (back[p].r.is_write && back[p].r.adr != NULL) { freet(back[p].r.adr); |