DP->go();
}
+ bool performSecPoll{true};
try {
- doSecPoll(slog, true);
+ performSecPoll = doSecPoll(slog, true);
}
catch (...) {
}
}
}
- secpollSince += sleeptime;
- if (secpollSince >= secpollInterval) {
- secpollSince = 0;
- try {
- doSecPoll(slog, false);
- }
- catch (...) {
+ if (performSecPoll) {
+ secpollSince += sleeptime;
+ if (secpollSince >= secpollInterval) {
+ secpollSince = 0;
+ try {
+ performSecPoll = doSecPoll(slog, false);
+ }
+ catch (...) {
+ }
}
}
}
/** Do an actual secpoll for the current version
* @param first bool that tells if this is the first secpoll run since startup
+ * @return whether polling should continue
*/
-void doSecPoll(Logr::log_t slog, bool first)
+bool doSecPoll(Logr::log_t slog, bool first)
{
if(::arg()["security-poll-suffix"].empty())
- return;
+ return false;
struct timeval now;
gettimeofday(&now, nullptr);
if (res == RCode::NXDomain && !isReleaseVersion(pkgv)) {
SLOG(g_log<<Logger::Warning<<"Not validating response for security status update, this is a non-release version"<<endl,
slog->info(Logr::Warning, "Not validating response for security status update, this is a non-release version"));
- return;
+ return false;
}
string security_message;
S.set("security-status", security_status);
SLOG(g_log<<Logger::Warning<<"Failed to retrieve security status update for '" + pkgv + "' on '"+ query + "': "<<pe.reason<<endl,
slog->error(Logr::Warning, pe.reason, "Failed to retrieve security status update", "package", Logging::Loggable(pkgv), "query", Logging::Loggable(query)));
- return;
+ return true;
}
SLOG(g_log<<Logger::Error<<"PowerDNS Security Update Mandatory: "<<g_security_message<<endl,
slog->info(Logr::Error, "PowerDNS Security Update Mandatory", "status", Logging::Loggable(g_security_message)));
}
+ return true;
}