From 1f1be4a9c68902c6aaa86b1e1b970117a8144069 Mon Sep 17 00:00:00 2001 From: Xuefer Date: Fri, 29 Jun 2007 03:09:47 +0000 Subject: [PATCH] merged [431] from b1.2: fast inc/dec was trying to break ro protection git-svn-id: svn://svn.lighttpd.net/xcache/trunk@433 c26eb9a1-5813-0410-bd6c-c2e55f420ca7 --- ChangeLog | 1 + xcache.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) 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 {