Submitted by: Jean-Jacques Clar, Cliff Woolley
Reviewed by: jwoolley, bnicholes, rederpj
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@102518
13f79535-47bb-0310-9956-
ffa450edef68
Changes with Apache 2.0.49
+ *) Fixed cache-removal order in mod_mem_cache.
+ [Jean-Jacques Clar, Cliff Woolley]
+
*) mod_setenvif: Fix the regex optimizer, which under circumstances
treated the supplied regex as literal string. PR 24219.
[André Malo]
APACHE 2.0 STATUS: -*-text-*-
-Last modified at [$Date: 2004/02/05 18:41:58 $]
+Last modified at [$Date: 2004/02/05 19:08:36 $]
Release:
bnicholes (looks good on Netware but then NetWare does not
use shared memory.)
- * Fix mod_mem_cache removal ordering bug.
- modules/experimental/mod_mem_cache.c r1.97,1.99
- modules/experimental/cache_cache.c r1.5
- +1: jwoolley, bnicholes, rederpj
-
* mod_auth_digest: Allow sub-requests with different methods than the
original request. PR 25040.
modules/aaa/mod_auth_digest.c: r1.82
/* FIX: If ejected is NULL, we'll segfault here */
priority = c->get_pri(ejected);
- if (c->queue_clock < priority)
+ if (c->queue_clock > priority)
c->queue_clock = priority;
cache_hash_set(c->ht,
#endif
}
/*
- * functions return a 'negative' score as lower is better in a priority Q
+ * functions return a 'negative' score since priority queues
+ * dequeue the object with the highest value first
*/
static long memcache_lru_algorithm(long queue_clock, void *a)
{
cache_object_t *obj = (cache_object_t *)a;
mem_cache_object_t *mobj = obj->vobj;
if (mobj->priority == 0)
- mobj->priority = ((long)(queue_clock + mobj->total_refs));
+ mobj->priority = queue_clock - mobj->total_refs;
/*
* a 'proper' LRU function would just be
* mobj->priority = mobj->total_refs;
*/
- return -1*mobj->priority;
+ return mobj->priority;
}
static long memcache_gdsf_algorithm(long queue_clock, void *a)
mem_cache_object_t *mobj = obj->vobj;
if (mobj->priority == 0)
- mobj->priority = queue_clock + (long)(mobj->total_refs*1000 / mobj->m_len);
+ mobj->priority = queue_clock -
+ (long)(mobj->total_refs*1000 / mobj->m_len);
- return -1*mobj->priority;
+ return mobj->priority;
}
static void cleanup_cache_object(cache_object_t *obj)