}
entry = container_of(node, struct cache_entry, eb);
- chunk_printf(&trash, "%p hash:%u size:%u (%u blocks), refcount:%u, expire:%d\n", entry, read_u32(entry->hash), block_ptr(entry)->len, block_ptr(entry)->block_count, block_ptr(entry)->refcount, entry->expire - (int)now.tv_sec);
-
next_key = node->key + 1;
+
+ if (entry->expire > now.tv_sec) {
+ chunk_printf(&trash, "%p hash:%u size:%u (%u blocks), refcount:%u, expire:%d\n",
+ entry, read_u32(entry->hash),
+ block_ptr(entry)->len, block_ptr(entry)->block_count,
+ block_ptr(entry)->refcount, entry->expire - (int)now.tv_sec);
+ } else {
+ /* time to remove that one */
+ eb32_delete(&entry->eb);
+ entry->eb.key = 0;
+ }
+
appctx->ctx.cli.i0 = next_key;
shctx_unlock(shctx_ptr(cache));