struct event peer_ev;
/* Local keypair */
gpointer key;
+ gboolean encrypted_only;
struct rspamd_keypair_cache *keypair_cache;
struct rspamd_fuzzy_backend *backend;
GQueue *updates_pending;
break;
}
+ if (session->ctx->encrypted_only && !encrypted) {
+ /* Do not accept unencrypted commands */
+ result.value = 403;
+ result.prob = 0.0;
+ goto reply;
+ }
+
if (cmd->cmd == FUZZY_CHECK) {
result = rspamd_fuzzy_backend_check (session->ctx->backend, cmd,
session->ctx->expire);
}
}
+reply:
result.tag = cmd->tag;
memcpy (&session->reply.rep, &result, sizeof (result));
keypair_cache_size),
RSPAMD_CL_FLAG_UINT);
+ rspamd_rcl_register_worker_option (cfg, type, "encrypted_only",
+ rspamd_rcl_parse_struct_boolean, ctx,
+ G_STRUCT_OFFSET (struct rspamd_fuzzy_storage_ctx, encrypted_only), 0);
+
+
return ctx;
}