diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-03-19 13:25:44 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-03-19 13:25:58 +0000 |
commit | 8fd4189a09d89cbd49527282eeb9360858a24148 (patch) | |
tree | 768cd84f44c0b4f71001e7bb03134cf67c41df4c /src/controller.c | |
parent | c4a0536e2b3622cb953e8b6ad2be53c723512bae (diff) | |
download | rspamd-8fd4189a09d89cbd49527282eeb9360858a24148.tar.gz rspamd-8fd4189a09d89cbd49527282eeb9360858a24148.zip |
[Fix] Make dynamic conf more NaN aware
Diffstat (limited to 'src/controller.c')
-rw-r--r-- | src/controller.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/controller.c b/src/controller.c index 0443062a1..09b446e8c 100644 --- a/src/controller.c +++ b/src/controller.c @@ -2184,8 +2184,18 @@ rspamd_controller_handle_saveactions ( act = METRIC_ACTION_GREYLIST; break; } - score = ucl_object_todouble (cur); - if (session->cfg->actions[act].score != score) { + + if (ucl_object_type (cur) == UCL_NULL) { + /* Assume NaN */ + score = NAN; + } + else { + score = ucl_object_todouble (cur); + } + + + if ((isnan (session->cfg->actions[act].score) != isnan (score)) || + (session->cfg->actions[act].score != score)) { add_dynamic_action (ctx->cfg, DEFAULT_METRIC, act, score); added ++; } |