]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Improve logging of the unknown settings id
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 5 Jul 2019 15:18:55 +0000 (16:18 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 5 Jul 2019 15:18:55 +0000 (16:18 +0100)
src/libserver/protocol.c

index 4f854328f7867ed326fa3c356fcc317fadd42d6c..bef7a0452afdfbada5f1a02d7a3aa5b00d067c27 100644 (file)
@@ -488,8 +488,20 @@ rspamd_protocol_handle_headers (struct rspamd_task *task,
                                                        task->cfg, hv_tok->begin, hv_tok->len);
 
                                        if (task->settings_elt == NULL) {
-                                               msg_warn_protocol ("unknown settings id: %V",
-                                                               hv);
+                                               GString *known_ids = g_string_new (NULL);
+                                               struct rspamd_config_settings_elt *cur;
+
+                                               DL_FOREACH (task->cfg->setting_ids, cur) {
+                                                       rspamd_printf_gstring (known_ids, "%s(%ud);",
+                                                                       cur->name, cur->id);
+                                               }
+
+                                               msg_warn_protocol ("unknown settings id: %V(%d); known_ids: %v",
+                                                               hv,
+                                                               rspamd_config_name_to_id (hv_tok->begin, hv_tok->len),
+                                                               known_ids);
+
+                                               g_string_free (known_ids, TRUE);
                                        }
                                        else {
                                                msg_debug_protocol ("applied settings id %V -> %ud", hv,