struct rspamd_http_upstream {
gchar *name;
+ gchar *settings_id;
struct upstream_list *u;
struct rspamd_cryptobox_pubkey *key;
gdouble timeout;
rspamd_inet_addr_t *client_addr;
struct rspamd_http_connection *client_conn;
struct rspamd_milter_session *client_milter_conn;
+ struct rspamd_http_upstream *backend;
gpointer map;
gchar *fname;
gpointer shmem_ref;
ucl_object_todouble_safe (elt, &up->timeout);
}
+ elt = ucl_object_lookup_any (obj, "settings", "settings_id", NULL);
+ if (elt && ucl_object_type (elt) == UCL_STRING) {
+ up->settings_id = rspamd_mempool_strdup (pool, ucl_object_tostring (elt));
+ }
+
/*
* Accept lua function here in form
* fun :: String -> UCL
NULL, (event_finalizer_t )rspamd_task_free, task);
data = rspamd_http_message_get_body (msg, &len);
+ if (session->backend->settings_id) {
+ rspamd_http_message_remove_header (msg, "Settings-ID");
+ rspamd_http_message_add_header (msg, "Settings-ID",
+ session->backend->settings_id);
+ }
+
/* Process message */
if (!rspamd_protocol_handle_request (task, msg)) {
msg_err_task ("cannot handle request: %e", task->err);
goto err;
}
else {
+ session->backend = backend;
+
if (backend->self_scan) {
return rspamd_proxy_self_scan (session);
}
session->ctx->local_key);
}
+ if (backend->settings_id != NULL) {
+ rspamd_http_message_remove_header (msg, "Settings-ID");
+ rspamd_http_message_add_header (msg, "Settings-ID",
+ backend->settings_id);
+ }
+
if (backend->local ||
rspamd_inet_address_is_local (
rspamd_upstream_addr (session->master_conn->up), FALSE)) {