httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Bloom <...@raleigh.ibm.com>
Subject Re: ap_current_time() is not intuitive
Date Thu, 06 Jan 2000 14:24:16 GMT
On Thu, 6 Jan 2000, Bill Stoddard wrote:

> > Having both a FILETIME and storing a unixtime is IMHO a very bad idea.
> > Because you will never know if somebody stored a value in the FILETIME
> > when you go to retrieve the unixtime, you will always have to convert from
> > FILETIME to unixtime
> The canonical representation is FILETIME, so it should always be present.
> The first time you request unixtime (or whatever we name it), you compute it
> from FILETIME. Subsequent requests fetch what is already there. Same with
> exploded time.

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.

Ryan

_______________________________________________________________________
Ryan Bloom		rbb@raleigh.ibm.com
4205 S Miami Blvd	
RTP, NC 27709		

Come to the first official Apache Software Foundation
Conference!  <http://ApacheCon.Com/>



Mime
View raw message