From: Zoran V. <zv...@ar...> - 2006-05-01 08:19:29
|
zvpb:~/sf/naviserver/nsd zoran$ diff -u cache.c.1.7 cache.c.1.8 --- cache.c.1.7 2006-05-01 10:07:00.000000000 +0200 +++ cache.c.1.8 2006-04-19 18:21:18.000000000 +0200 @@ -36,7 +36,7 @@ #include "nsd.h" -NS_RCSID("@(#) $Header: /cvsroot/naviserver/naviserver/nsd/cache.c,v 1.7 2006/04/15 21:14:57 sdeasey Exp $"); +NS_RCSID("@(#) $Header: /cvsroot/naviserver/naviserver/nsd/cache.c,v 1.8 2006/04/18 19:42:16 sdeasey Exp $"); struct Cache; @@ -437,9 +437,9 @@ Ns_CacheUnsetValue(entry); ePtr->value = value; ePtr->size = size; - if (ttl > 0) { + if (ttl > 0 || cachePtr->ttl > 0) { Ns_GetTime(&now); - Ns_IncrTime(&ePtr->expires, ttl, 0); + Ns_IncrTime(&ePtr->expires, ttl ? ttl : cachePtr->ttl, 0); } cachePtr->currentSize += size; if (ePtr->cachePtr->maxSize > 0) { I have troubles with our code because of the above change. The 1.7 release works, the 1.8 not. I get following error: timeout waiting for update or entry flushed when I do [ns_cache_eval ...] Now, is this right (and it opens another hole) or is this wrong? We use: ns_cache_create -ttl 600 ns_cache_eval $cname $key {...} When I go and bump the cachetimeout parameter to 60 (default is 3) the process waits for 60 seconds and throws the same error message. Cheers Zoran |