}
/* Static checks */
- if (!enabled ||
+ if (!(internal_flags & cache_item::bit_enabled) ||
(RSPAMD_TASK_IS_EMPTY(task) && !(flags & SYMBOL_TYPE_EMPTY)) ||
(flags & SYMBOL_TYPE_MIME_ONLY && !RSPAMD_TASK_IS_MIME(task))) {
- if (!enabled) {
+ if (!(internal_flags & cache_item::bit_enabled)) {
msg_debug_cache_task("skipping %s of %s as it is permanently disabled",
what, symbol.c_str());
struct rspamd_symcache_item_stat *st = nullptr;
struct rspamd_counter_data *cd = nullptr;
+ std::string symbol;
+
/* Unique id - counter */
int id;
std::uint64_t last_count = 0;
- std::string symbol;
symcache_item_type type;
int flags;
- /* Condition of execution */
- bool enabled = true;
+ static constexpr const auto bit_enabled = 0b0001;
+ static constexpr const auto bit_sync = 0b0010;
+ static constexpr const auto bit_slow = 0b0100;
+ int internal_flags = bit_enabled;
/* Priority */
int priority = 0;
void *user_data,
symcache_item_type _type,
int _flags)
- : id(_id),
- symbol(std::move(name)),
+ : symbol(std::move(name)),
+ id(_id),
type(_type),
flags(_flags),
priority(_priority),
int parent,
symcache_item_type _type,
int _flags)
- : id(_id),
- symbol(std::move(name)),
+ : symbol(std::move(name)),
+ id(_id),
type(_type),
flags(_flags),
specific(virtual_item{parent})