summaryrefslogtreecommitdiff
path: root/src/htsback.c
diff options
context:
space:
mode:
authorXavier Roche <xroche@users.noreply.github.com>2013-04-14 10:02:13 +0000
committerXavier Roche <xroche@users.noreply.github.com>2013-04-14 10:02:13 +0000
commitfe7e71e751afae06dc0ad1c62d536e2a4278ca17 (patch)
treee90b38997664b0de591003981e8538d327a54dbf /src/htsback.c
parentefa69be688b62ebe3671d9e5d5cd5ade5a203a7e (diff)
Do not report "broken file" message for incomplete files.
Diffstat (limited to 'src/htsback.c')
-rw-r--r--src/htsback.c13
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);