auto *real_cache = C_API_SYMCACHE(cache);
real_cache->set_peak_cb(cbref);
+}
+
+gboolean
+rspamd_symcache_add_condition_delayed (struct rspamd_symcache *cache,
+ const gchar *sym, lua_State *L, gint cbref)
+{
+ auto *real_cache = C_API_SYMCACHE(cache);
+
+ real_cache->add_delayed_condition(sym, cbref);
+
+ return TRUE;
}
\ No newline at end of file
msg_info_cache("registered peak callback");
}
+auto symcache::add_delayed_condition(std::string_view sym, int cbref) -> void
+{
+ delayed_conditions->emplace_back(sym, cbref, (lua_State *)cfg->lua_state);
+}
auto cache_item::get_parent(const symcache &cache) const -> const cache_item *
{
std::string sym;
int cbref;
lua_State *L;
+public:
+ delayed_cache_condition(std::string_view _sym, int _cbref, lua_State *_L) :
+ sym(_sym), cbref(_cbref), L(_L) {}
};
class symcache {
* @param cbref
*/
auto set_peak_cb(int cbref) -> void;
+
+ /**
+ * Add a delayed condition for a symbol that might not be registered yet
+ * @param sym
+ * @param cbref
+ */
+ auto add_delayed_condition(std::string_view sym, int cbref) -> void;
};
/*