diff --git a/ChangeLog b/ChangeLog index 00bf5af..321319a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ ChangeLog * could not show module info in admin page when XCache is the last module * wrong http auth realm * #86: remove/edit variable in admin page + * fixed #109: fast inc/dec was trying to break ro protection * fixed #101, #105: Fixed compatibility issue for apache 1.x * fixed #94: Garbage collector disabled when xcache.cacher set to off * fixed #92: Zend Optimizer compatibility issue diff --git a/xcache.c b/xcache.c index 71a441f..1cc2f12 100644 --- a/xcache.c +++ b/xcache.c @@ -2185,13 +2185,16 @@ static inline void xc_var_inc_dec(int inc, INTERNAL_FUNCTION_PARAMETERS) /* {{{ /* do it in place */ stored_var = stored_xce->data.var; if (Z_TYPE_P(stored_var->value) == IS_LONG) { + zval *zv; stored_xce->ctime = XG(request_time); stored_xce->ttl = xce.ttl; TRACE("%s", "incdec: islong"); value = Z_LVAL_P(stored_var->value); value += (inc == 1 ? count : - count); RETVAL_LONG(value); - Z_LVAL_P(stored_var->value) = value; + + zv = (zval *) xce.cache->shm->handlers->to_readwrite(xce.cache->shm, (char *) stored_var->value); + Z_LVAL_P(zv) = value; break; /* leave lock */ } else {