Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libfreshclam/libfreshclam.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,8 @@ fc_error_t fc_dns_query_update_info(
reply_token = NULL;

time(&currentTime);
if ((int)currentTime - recordTime > 10800) {
logg(LOGG_WARNING, "DNS record is older than 3 hours.\n");
if ((int)currentTime - recordTime > DNS_WARNING_THRESHOLD_SECONDS) {
logg(LOGG_WARNING, "DNS record is older than %d hours.\n", DNS_WARNING_THRESHOLD_HOURS);
goto done;
}

Expand Down
4 changes: 2 additions & 2 deletions libfreshclam/libfreshclam_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1958,8 +1958,8 @@ static fc_error_t query_remote_database_version(
recordTime = atoi(recordTimeStr);
free(recordTimeStr);
time(&currentTime);
if ((int)currentTime - recordTime > 10800) {
logg(LOGG_WARNING, "DNS record is older than 3 hours.\n");
if ((int)currentTime - recordTime > DNS_WARNING_THRESHOLD_SECONDS) {
logg(LOGG_WARNING, "DNS record is older than %d hours.\n", DNS_WARNING_THRESHOLD_HOURS);
} else if (NULL != (verStrDnsExtra = cli_strtok(extradnsreply, 0, ":"))) {
if (!cli_isnumber(verStrDnsExtra)) {
logg(LOGG_WARNING, "Broken database version in TXT record for %s\n", cvdfile);
Expand Down
4 changes: 4 additions & 0 deletions libfreshclam/libfreshclam_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,8 @@ fc_error_t updatecustomdb(
char **dbFilename,
int *bUpdated);


#define DNS_WARNING_THRESHOLD_HOURS 12
#define DNS_WARNING_THRESHOLD_SECONDS (DNS_WARNING_THRESHOLD_HOURS * 60 * 60)

#endif // __LIBFRESHCLAM_INTERNAL_H