google-code-export / lusca-cache

Automatically exported from code.google.com/p/lusca-cache
0 stars 0 forks source link

percetage max values in refresh pattern #137

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This issue is the same as http://bugs.squid-cache.org/show_bug.cgi?id=2949
In Squid, it has been solved (just on 3.x).

I've just checked the exact code on src/refresh.c source file on r14809 Lusca. 
I didn't made an "in field" test.

If refresh pattern percent value (R->pct) is too big, stale_age will become 
negative, instead of "really big".

time_t stale_age = (entry->timestamp - entry->lastmod) * R->pct;

I've made a small patch to check and workaround the problem. It adds 1000 
seconds to stale age related to age value.
-----
/* if too high, stale_age may become incorrectly negative */
if(stale_age < 0 && R->pct > 0 && entry->timestamp > entry->lastmod) { 
stale_age = age + 1000; }

Original issue reported on code.google.com by luciano....@gmail.com on 9 Jan 2011 at 7:15

Attachments:

GoogleCodeExporter commented 9 years ago
Up, got this also during debug, lusca compiled with -ftrapv
I guess patch will fix some issues.

Original comment by nuclear...@gmail.com on 12 Feb 2011 at 1:01