aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2023-08-17 12:00:48 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2023-08-17 12:00:48 +0100
commit23bc82085c7dc90cb7fffb5e5363647eb5b9b39b (patch)
treea255d4a705759ab9a698357da3ff78979063d2a1 /src
parent0f870719446175344b36db504c08f8e5773a8348 (diff)
downloadrspamd-23bc82085c7dc90cb7fffb5e5363647eb5b9b39b.tar.gz
rspamd-23bc82085c7dc90cb7fffb5e5363647eb5b9b39b.zip
[Minor] Allow workers to have any attributes (needed by fuzzy)
Diffstat (limited to 'src')
-rw-r--r--src/fuzzy_storage.c8
-rw-r--r--src/libserver/cfg_rcl.cxx3
-rw-r--r--src/rspamd.h1
3 files changed, 7 insertions, 5 deletions
diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c
index 0110ed8c2..21c5c271e 100644
--- a/src/fuzzy_storage.c
+++ b/src/fuzzy_storage.c
@@ -1,11 +1,11 @@
-/*-
- * Copyright 2016 Vsevolod Stakhov
+/*
+ * Copyright 2023 Vsevolod Stakhov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -61,7 +61,7 @@ worker_t fuzzy_worker = {
"fuzzy", /* Name */
init_fuzzy, /* Init function */
start_fuzzy, /* Start function */
- RSPAMD_WORKER_HAS_SOCKET,
+ RSPAMD_WORKER_HAS_SOCKET | RSPAMD_WORKER_NO_STRICT_CONFIG,
RSPAMD_WORKER_SOCKET_UDP, /* UDP socket */
RSPAMD_WORKER_VER /* Version info */
};
diff --git a/src/libserver/cfg_rcl.cxx b/src/libserver/cfg_rcl.cxx
index 196c15e57..cfa8b0f67 100644
--- a/src/libserver/cfg_rcl.cxx
+++ b/src/libserver/cfg_rcl.cxx
@@ -810,7 +810,8 @@ rspamd_rcl_worker_handler(rspamd_mempool_t *pool, const ucl_object_t *obj,
}
}
}
- else if (known_worker_attributes.find(std::string_view{ucl_object_key(cur)}) == known_worker_attributes.end()) {
+ else if (!(wrk->worker->flags & RSPAMD_WORKER_NO_STRICT_CONFIG) &&
+ known_worker_attributes.find(std::string_view{ucl_object_key(cur)}) == known_worker_attributes.end()) {
msg_warn_config("unknown worker attribute: %s; worker type: %s", ucl_object_key(cur), worker_type);
}
}
diff --git a/src/rspamd.h b/src/rspamd.h
index 8c92e1818..523ea79c3 100644
--- a/src/rspamd.h
+++ b/src/rspamd.h
@@ -68,6 +68,7 @@ enum rspamd_worker_flags {
RSPAMD_WORKER_CONTROLLER = (1 << 6),
RSPAMD_WORKER_NO_TERMINATE_DELAY = (1 << 7),
RSPAMD_WORKER_OLD_CONFIG = (1 << 8),
+ RSPAMD_WORKER_NO_STRICT_CONFIG = (1 << 9),
};
struct rspamd_worker_accept_event {