]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Allow workers to have any attributes (needed by fuzzy)
authorVsevolod Stakhov <vsevolod@rspamd.com>
Thu, 17 Aug 2023 11:00:48 +0000 (12:00 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Thu, 17 Aug 2023 11:00:48 +0000 (12:00 +0100)
src/fuzzy_storage.c
src/libserver/cfg_rcl.cxx
src/rspamd.h

index 0110ed8c250ce78bb6ba2b73ac176d2b5dc9fe70..21c5c271e59a36c331eb2ad92cc58f76b63a8f73 100644 (file)
@@ -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 */
 };
index 196c15e57670735f33161861956a6827c0df2773..cfa8b0f67f7850611260e0fd5a8fc62072398137 100644 (file)
@@ -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);
                        }
                }
index 8c92e1818904022b1e8a63b7964f536e22ada33b..523ea79c3ea2cbee8aa2f383009cd2ba55023e92 100644 (file)
@@ -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 {