struct rspamd_rcl_struct_parser *pd = (struct rspamd_rcl_struct_parser *)ud;
khash_t(fuzzy_key_ids_set) *target;
- target = (khash_t(fuzzy_key_ids_set) *)pd->user_struct;
+ target = *(khash_t(fuzzy_key_ids_set) **)((gchar *)pd->user_struct + pd->offset);
if (ucl_object_type (obj) == UCL_ARRAY) {
const ucl_object_t *cur;
type,
"forbidden_ids",
fuzzy_parse_ids,
- ctx->default_forbidden_ids,
- 0,
+ ctx,
+ G_STRUCT_OFFSET(struct rspamd_fuzzy_storage_ctx, default_forbidden_ids),
0,
"Deny specific flags by default");
type,
"weak_ids",
fuzzy_parse_ids,
- ctx->weak_ids,
- 0,
+ ctx,
+ G_STRUCT_OFFSET(struct rspamd_fuzzy_storage_ctx, weak_ids),
0,
"Treat these flags as weak (i.e. they do not overwrite strong flags)");
while ((cur = ucl_object_iterate_full (it, UCL_ITERATE_EXPLICIT)) != NULL) {
srch.name = ucl_object_key (cur);
- srch.ptr = wrk->ctx; /* XXX: is it valid? */
+ srch.ptr = wrk->ctx; /* XXX: is it valid? Update! no, it is not valid, omfg... */
whandler = g_hash_table_lookup (wparser->parsers, &srch);
if (whandler != NULL) {
* @param type type of worker (GQuark)
* @param name name of option
* @param handler handler of option
- * @param target opaque target structure
+ * @param target opaque target structure, note it **MUST** be worker ctx due to some reasons I don't really remember
* @param offset offset inside a structure
*/
void rspamd_rcl_register_worker_option (struct rspamd_config *cfg,