diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-08-16 13:22:47 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-08-16 13:22:47 +0100 |
commit | da9a40771dc063e8773542a1c8d278f651d1b0fc (patch) | |
tree | 7596c6dc9f09539466e1e806fa81e8f71293ee94 /src/libserver/protocol.c | |
parent | 00b12b55c6100504091da0d1489ac282833e33dc (diff) | |
download | rspamd-da9a40771dc063e8773542a1c8d278f651d1b0fc.tar.gz rspamd-da9a40771dc063e8773542a1c8d278f651d1b0fc.zip |
[Minor] Warn about using of settings and settings-id together
Diffstat (limited to 'src/libserver/protocol.c')
-rw-r--r-- | src/libserver/protocol.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c index 3f07926be..ef8700340 100644 --- a/src/libserver/protocol.c +++ b/src/libserver/protocol.c @@ -446,7 +446,7 @@ rspamd_protocol_handle_headers (struct rspamd_task *task, struct rspamd_http_message *msg) { rspamd_ftok_t *hn_tok, *hv_tok, srch; - gboolean has_ip = FALSE; + gboolean has_ip = FALSE, seen_settings_header = FALSE; struct rspamd_http_header *header, *h, *htmp; gchar *ntok; @@ -601,6 +601,10 @@ rspamd_protocol_handle_headers (struct rspamd_task *task, task->settings_elt->id); } } + IF_HEADER (SETTINGS_HEADER) { + msg_debug_protocol ("read settings header, value: %T", hv_tok); + seen_settings_header = TRUE; + } break; case 'u': case 'U': @@ -696,6 +700,14 @@ rspamd_protocol_handle_headers (struct rspamd_task *task, } } + if (seen_settings_header && task->settings_elt) { + msg_warn_task ("ignore settings id %s as settings header is also presented", + task->settings_elt->name); + REF_RELEASE (task->settings_elt); + + task->settings_elt = NULL; + } + if (!has_ip) { task->flags |= RSPAMD_TASK_FLAG_NO_IP; } |