From 21a851b52f602e9bd3be9039066e56198fa6b382 Mon Sep 17 00:00:00 2001 From: Tomasz Kojm Date: Tue, 25 Jan 2005 05:16:45 +0000 Subject: [PATCH] properly count signatures in --no-dns mode git-svn: trunk@1272 --- clamav-devel/ChangeLog | 5 +++++ clamav-devel/freshclam/manager.c | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/clamav-devel/ChangeLog b/clamav-devel/ChangeLog index 8ab5e4780..c9002083a 100644 --- a/clamav-devel/ChangeLog +++ b/clamav-devel/ChangeLog @@ -1,3 +1,8 @@ +Tue Jan 25 06:13:29 CET 2005 (tk) +--------------------------------- + * freshclam/manager.c: properly count signatures in --no-dns mode (problem + reported by Tomasz Papszun) + Tue Jan 25 05:09:42 CET 2005 (tk) --------------------------------- * clamscan/manager.c: fix bad path completion when using options for external diff --git a/clamav-devel/freshclam/manager.c b/clamav-devel/freshclam/manager.c index 0cadcf49f..ab796ed4f 100644 --- a/clamav-devel/freshclam/manager.c +++ b/clamav-devel/freshclam/manager.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002 - 2004 Tomasz Kojm + * Copyright (C) 2002 - 2005 Tomasz Kojm * HTTP/1.1 compliance by Arkadiusz Miskiewicz * Proxy support by Nigel Horne * Proxy authorization support by Gernot Tenchio @@ -290,9 +290,8 @@ int downloaddb(const char *localname, const char *remotename, const char *hostna if(!nodb && !ims) { mprintf("%s is up to date (version: %d, sigs: %d, f-level: %d, builder: %s)\n", localname, current->version, current->sigs, current->fl, current->builder); logg("%s is up to date (version: %d, sigs: %d, f-level: %d, builder: %s)\n", localname, current->version, current->sigs, current->fl, current->builder); - if(current) - cl_cvdfree(current); - + *signo += current->sigs; + cl_cvdfree(current); return 1; } @@ -523,11 +522,12 @@ struct cl_cvd *remote_cvdhead(const char *file, int socketfd, const char *hostna } } - if(stat(file, &sb) != -1) { + if(stat(file, &sb) != -1 && sb.st_mtime < time(NULL)) { Rfc2822DateTime(last_modified, sb.st_mtime); } else { time_t mtime = 1104119530; Rfc2822DateTime(last_modified, mtime); + mprintf("*Assuming modification time in the past\n"); } mprintf("*If-Modified-Since: %s\n", last_modified);