Browse Source

fix cache clear corrupted bug

git-svn-id: svn://svn.lighttpd.net/xcache/branches/1.0@141 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
1.0
Xuefer 15 years ago
parent
commit
68279dc12c
  1. 7
      xcache.c

7
xcache.c

@ -402,7 +402,7 @@ static void xc_entry_gc_real(xc_cache_t **caches, int size TSRMLS_DC) /* {{{ */
ENTER_LOCK(cache) {
if (cache->deletes) {
last = (xc_delete_t *) &cache->deletes;
for (p = *last; p; p = p->next) {
for (p = *last; p; p = *last) {
if (t - p->dtime > 3600) {
p->refcount = 0;
/* issue warning here */
@ -1206,7 +1206,7 @@ static void xcache_admin_operate(xcache_op_type optype, INTERNAL_FUNCTION_PARAME
break;
case XC_OP_CLEAR:
{
xc_entry_t *e;
xc_entry_t *e, *next;
int i, c;
if (id < 0 || id >= size) {
@ -1217,7 +1217,8 @@ static void xcache_admin_operate(xcache_op_type optype, INTERNAL_FUNCTION_PARAME
cache = caches[id];
ENTER_LOCK(cache) {
for (i = 0, c = cache->hentry->size; i < c; i ++) {
for (e = cache->entries[i]; e; e = e->next) {
for (e = cache->entries[i]; e; e = next) {
next = e->next;
xc_entry_remove_dmz(e TSRMLS_CC);
}
cache->entries[i] = NULL;

Loading…
Cancel
Save