From dc0db67742d74b8a4081e51e76a62e3961414147 Mon Sep 17 00:00:00 2001 From: Xavier Roche Date: Wed, 21 Mar 2012 20:00:28 +0000 Subject: Fixed incredible bug leading to reject html files from cache not present on disk (spotted by Alain Desilets) --- src/htsback.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/htsback.c b/src/htsback.c index 1c77c29..fae9bbc 100644 --- a/src/htsback.c +++ b/src/htsback.c @@ -1453,7 +1453,8 @@ int back_add(struct_back* sback,httrackp* opt,cache_back* cache,char* adr,char* // Ok, noté en cache->. mais bien présent dans le cache ou sur disque? #if HTS_FAST_CACHE - if (hash_pos_return) { + // negative values when data is not in cache + if (hash_pos_return < 0) { #else if (a) { #endif @@ -1514,12 +1515,12 @@ int back_add(struct_back* sback,httrackp* opt,cache_back* cache,char* adr,char* FILE* fp=fopen(fconv(catbuff,save),"wb"); if (fp) fclose(fp); if (opt->log!=NULL) { - HTS_LOG(opt,LOG_WARNING); fprintf(opt->log,"Previous file not found (erased by user ?), ignoring: %s%s"LF,back[p].url_adr,back[p].url_fil); test_flush; + HTS_LOG(opt,LOG_WARNING); fprintf(opt->log,"Previous file '%s' not found (erased by user ?), ignoring: %s%s"LF,save,back[p].url_adr,back[p].url_fil); test_flush; } } } else { if (opt->log!=NULL) { - HTS_LOG(opt,LOG_WARNING); fprintf(opt->log,"Previous file not found (erased by user ?), recatching: %s%s"LF,back[p].url_adr,back[p].url_fil); test_flush; + HTS_LOG(opt,LOG_WARNING); fprintf(opt->log,"Previous file '%s' not found (erased by user ?), recatching: %s%s"LF,save,back[p].url_adr,back[p].url_fil); test_flush; } } } -- cgit v1.2.3