rspamd_rcl_register_worker_option (cfg, type, "keypair",
fuzzy_parse_keypair, ctx,
- 0, 0);
+ 0, RSPAMD_CL_FLAG_MULTIPLE);
rspamd_rcl_register_worker_option (cfg, type, "keypair_cache_size",
rspamd_rcl_parse_struct_integer, ctx,
const gchar *key, gpointer ud,
struct rspamd_rcl_section *section, GError **err)
{
- const ucl_object_t *val, *cur;
+ const ucl_object_t *val, *cur, *cur_obj;
ucl_object_t *robj;
ucl_object_iter_t it = NULL;
const gchar *worker_type, *worker_bind;
it = NULL;
while ((cur = ucl_iterate_object (obj, &it, true)) != NULL) {
HASH_FIND_STR (wparser->parsers, ucl_object_key (cur), whandler);
+
if (whandler != NULL) {
- if (!whandler->handler (cfg->cfg_pool, cur, &whandler->parser,
- section, err)) {
- return FALSE;
+
+ LL_FOREACH (cur, cur_obj) {
+ if (!whandler->handler (cfg->cfg_pool,
+ cur_obj,
+ &whandler->parser,
+ section,
+ err)) {
+ return FALSE;
+ }
+
+ if (!whandler->parser.flags & RSPAMD_CL_FLAG_MULTIPLE) {
+ break;
+ }
}
}
}
rspamd_mempool_t *pool, const ucl_object_t *obj, gpointer ptr,
GError **err)
{
- const ucl_object_t *found;
+ const ucl_object_t *found, *cur_obj;
struct rspamd_rcl_default_handler_data *cur, *tmp;
if (obj->type != UCL_OBJECT) {
found = ucl_object_find_key (obj, cur->key);
if (found != NULL) {
cur->pd.user_struct = ptr;
- if (!cur->handler (pool, found, &cur->pd, section, err)) {
- return FALSE;
+
+ LL_FOREACH (found, cur_obj) {
+ if (!cur->handler (pool, cur_obj, &cur->pd, section, err)) {
+ return FALSE;
+ }
+
+ if (!cur->pd.flags & RSPAMD_CL_FLAG_MULTIPLE) {
+ break;
+ }
}
}
}
RSPAMD_CL_FLAG_INT_SIZE = 0x1 << 9,
RSPAMD_CL_FLAG_STRING_PATH = 0x1 << 10,
RSPAMD_CL_FLAG_BOOLEAN_INVERSE = 0x1 << 11,
- RSPAMD_CL_FLAG_STRING_LIST_HASH = 0x1 << 12
+ RSPAMD_CL_FLAG_STRING_LIST_HASH = 0x1 << 12,
+ RSPAMD_CL_FLAG_MULTIPLE = 0x1 << 13
};
struct rspamd_rcl_struct_parser {