The other day, something was odd about my DNS environment and freshclam's DNS queries were failing or contained bogus data. This caused freshclam to fallback to using http If-Modified-Since to determine the need for an update. I was testing the reload logic in clamd and was forcing changes to the daily.cvd file by manually copying an older version over the current one. After doing this, I noticed that freshclam was not fetching a new version of the daily.cvd database even though I had replaced the current one with an older version. I looked into the details and determined that freshclam was using the file's mtime as the "If-Modified-Since" time in the http query. It would seem that the better thing to do would be to use the internal timestamp in the database (i.e. the cvd's stime).

The attached small patch does this. With this patch, the decision to download a new database is made on the same data elements (i.e. the version of the current database) vs. what is available regardless of if the decision is made using DNS provided information or an http If-Modified-Since query.

- Mark Pizzolato

Attachment: clamav-devel-20050309.freshclam.modifydate.patch
Description: Binary data

_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html

Reply via email to