#include <glob.h>
#endif
+#include <math.h>
+
struct rspamd_rcl_default_handler_data {
struct rspamd_rcl_struct_parser pd;
gchar *key;
continue;
}
else {
- if (!ucl_object_todouble_safe (cur, &action_score)) {
- g_set_error (err,
- CFG_RCL_ERROR,
- EINVAL,
- "invalid action definition: '%s'",
- ucl_object_key (cur));
- ucl_object_iterate_free (it);
+ if (ucl_object_type (cur) == UCL_NULL) {
+ action_score = NAN;
+ }
+ else {
+ if (!ucl_object_todouble_safe (cur, &action_score)) {
+ g_set_error (err,
+ CFG_RCL_ERROR,
+ EINVAL,
+ "invalid action definition: '%s'",
+ ucl_object_key (cur));
+ ucl_object_iterate_free (it);
- return FALSE;
+ return FALSE;
+ }
}
+
rspamd_config_set_action_score (cfg,
ucl_object_key (cur),
action_score,