Skip to content

Commit a0fda74

Browse files
authored
Merge pull request #17381 from rgacogne/ddist-fix-set-health-check-params
dnsdist: Fix DownstreamState::setHealthCheckParams
2 parents 597b2c5 + cab10e6 commit a0fda74

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

pdns/dnsdistdist/dnsdist-lua-bindings.cc

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -293,20 +293,16 @@ void setupLuaBindings(LuaContext& luaCtx, bool client, bool configCheck)
293293
return;
294294
}
295295
size_t value = 0;
296-
getOptionalValue<size_t>(vars, "maxCheckFailures", value);
297-
if (value > 0) {
296+
if (getOptionalValue<size_t>(vars, "maxCheckFailures", value) > 0 && value > 0) {
298297
state->d_config.maxCheckFailures.store(value);
299298
}
300-
getOptionalValue<size_t>(vars, "rise", value);
301-
if (value > 0) {
299+
if (getOptionalValue<size_t>(vars, "rise", value) > 0 && value > 0) {
302300
state->d_config.minRiseSuccesses.store(value);
303301
}
304-
getOptionalValue<size_t>(vars, "checkTimeout", value);
305-
if (value > 0) {
302+
if (getOptionalValue<size_t>(vars, "checkTimeout", value) > 0 && value > 0) {
306303
state->d_config.checkTimeout.store(value);
307304
}
308-
getOptionalValue<size_t>(vars, "checkInterval", value);
309-
if (value > 0) {
305+
if (getOptionalValue<size_t>(vars, "checkInterval", value) > 0 && value > 0) {
310306
state->d_config.checkInterval.store(value);
311307
}
312308
});

0 commit comments

Comments
 (0)