Previously, the global regexp index `i` was included in per-class hashes,
which caused class B's hash to change when class A got new regexps
(because indices shift). This made Redis caching ineffective as databases
were constantly being recompiled.
Now the global index is only included in the global hash, not in per-class
hashes, ensuring each class hash depends only on its own regexps.
sizeof(fl));
rspamd_cryptobox_hash_update(&st_global, (const unsigned char *) &fl,
sizeof(fl));
- /* Numeric order */
- rspamd_cryptobox_hash_update(re_class->st, (const unsigned char *) &i,
- sizeof(i));
+ /* Global index - only in global hash, not per-class (to avoid
+ * class hash instability when other classes change) */
rspamd_cryptobox_hash_update(&st_global, (const unsigned char *) &i,
sizeof(i));
}