httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject Re: ap_current_time() is not intuitive
Date Thu, 06 Jan 2000 19:54:21 GMT
On Thu, 6 Jan 2000, Ryan Bloom wrote:
> > > And hence the bug.  I get the currenttime, which is stored as a FILETIME.
> > > I then ask for the unixtime, and that value is stored.  Next, I insert a
> > > new FILETIME, but asking for the current time again, or by inserting it
> > > with ap_put_os_time.  The next time I ask for the unixtime, I will get the
> > > original time, which is wrong.  Take a look at the function which does the
> > > conversion, it is some bit shifting, a simple bitwise or, and some
> > > subtracting.  It just isn't slow enough to not call whenever we want the
> > > unixtime.
> > 
> > Then make sure to clear the bit whenever a new FILETIME is stored. That
> > bug does not invalidate the basic premise that FILETIME is the "proper"
> > base format.
> > 
> > +1 to use FILETIME for the authoritative time format (and derive other
> > formats from that).
> > 
> 
> I agree 100% that FILETIME is the correct base format on Windows.  I
> disagree that we should be storing the time_t format at all.  Storing it
> is useless, because we have to check a bit every time regardless, and the
> conversion routine is small and fast, and should be made inline as soon as
> we start looking at making those types of changes.

All right. Reread your last sentence and see if you can parse it. I
couldn't :-)

If the conversion is fast, then yah... skip caching the value.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/


Mime
View raw message