summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorXavier Roche <xroche@users.noreply.github.com>2013-04-14 10:04:03 +0000
committerXavier Roche <xroche@users.noreply.github.com>2013-04-14 10:04:03 +0000
commit67b29c973b8b53031435f45b90ff3369be8536ed (patch)
tree5c3b48405df81655767f1e24dbe00631b6f7af78 /src
parentfe7e71e751afae06dc0ad1c62d536e2a4278ca17 (diff)
Report incomplete files as info
Diffstat (limited to 'src')
-rw-r--r--src/htsback.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/htsback.c b/src/htsback.c
index 5a6ef2e..4276b9b 100644
--- a/src/htsback.c
+++ b/src/htsback.c
@@ -456,12 +456,22 @@ 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].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, expected %d got %d): %s%s"LF,
- back[p].r.totalsize, back[p].r.size, back[p].url_adr,back[p].url_fil);
+ /* Don't store broken files. Note: check is done before compression.
+ If the file is partial, the next run will attempt to continue it with compression too.
+ */
+ if (back[p].r.totalsize > 0 && back[p].r.size != back[p].r.totalsize && ! opt->tolerant) {
+ if (back[p].status == STATUS_READY) {
+ if (opt->log!=NULL) {
+ 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);
+ }
+ } else {
+ if (opt->log!=NULL) {
+ HTS_LOG(opt,LOG_INFO);
+ fprintf(opt->log, "incomplete file not yet stored in cache (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;