Re: squid_curtime can be smaller than e->lastref time?

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Sun, 7 Apr 2002 14:09:48 +0200

On Sunday 07 April 2002 07:22, wrote:
> Hi, pals!
>
> In file store_heap_replacement.c, line 75. ( I am using squid
> stable 2.4) There is a statement like this:
> else if (squid_curtime <= e->lastref)
> tie = 0.0;
> else
> tie = 1.0 - exp((double) (e->lastref - squid_curtime) / 86400.0);
>
> I think squid_curtime is the time right now, and is always greated
> than the past time ( I think the e->lastref is some past time).
>
> So I can not imagine the case that squid_time is smaller than the
> e->lastref, Can you show me the case?

It can be smaller when you have changed your system clock "backwards".

> I think maybe it is because "squid_time" does not refresh
> immediately, but I am not sure about it. When will squid_time be
> refreshed? How does it refresh?

squid_curtime is in seconds, so there may be many references during
the same squid_curtime value.

It is refreshed once per select/poll loop.

Regards
Henrik Nordstrm
Squid Developer
Received on Sun Apr 07 2002 - 15:58:01 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:58 MST