local _,_,ext = string.find(r['addr'], rule['pattern'])
if ext then
if rule['cdb'] then
- if rule['hash']:lookup(hv) then
+ if rule['hash']:lookup(ext) then
task:insert_result(rule['symbol'], 1)
end
else
- if rule['hash']:get_key(hv) then
+ if rule['hash']:get_key(ext) then
task:insert_result(rule['symbol'], 1)
end
end
*cache = pcache;
pcache->static_pool = memory_pool_new (memory_pool_get_size ());
}
-
-
- if (weight > 0) {
- target = &(*cache)->static_items;
- }
- else {
- target = &(*cache)->negative_items;
- }
item = memory_pool_alloc0 (pcache->static_pool, sizeof (struct cache_item));
item->s = memory_pool_alloc0 (pcache->static_pool, sizeof (struct saved_cache_item));
else {
item->s->weight = weight;
}
+
+ if (item->s->weight > 0) {
+ target = &(*cache)->static_items;
+ }
+ else {
+ target = &(*cache)->negative_items;
+ }
+
pcache->used_items++;
msg_debug ("used items: %d, added symbol: %s", (*cache)->used_items, name);
set_counter (item->s->symbol, 0);