HTML fuzzy hashes were incorrectly cached using the standard text fuzzy
cache key via fuzzy_cmd_set_cached(), causing HTML hashes to overwrite
text hashes for the same part. Now HTML fuzzy uses the dedicated
html_cache_key for both read and write operations, preventing cache
conflicts and ensuring proper retrieval of HTML fuzzy data.
return NULL;
}
- fuzzy_cmd_set_cached(rule, task, mp, cached);
+ /* Save to HTML-specific cache (not standard text cache) */
+ if (!html_cached_ptr) {
+ html_cached_ptr = rspamd_mempool_alloc0(task->task_pool, sizeof(*html_cached_ptr) *
+ (MESSAGE_FIELD(task, parts)->len + 1));
+ rspamd_mempool_set_variable(task->task_pool, html_cache_key, html_cached_ptr, NULL);
+ }
+ html_cached_ptr[mp->part_number] = cached;
}
io = rspamd_mempool_alloc(task->task_pool, sizeof(*io));