tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Anderson <...@squeat.com>
Subject Re: Why "/ 1000 * 1000
Date Thu, 15 Sep 2005 05:40:25 GMT
I'm assuming ifModifiedSince is already a multiple of 1000 (these are  
times in msec).   In that case, the following comparison would do the  
same thing:

     if (ifModifiedSince < (lastModified - 999))
or
     if (ifModifiedSince <= (lastModified - 1000))

But I suppose that /1000*1000 might be considered more "intuitive".    
Okay, I admit that's not exactly intuitive either.   But they're both  
better than the suggestion in bug 33933 (no offense intended).    
http://issues.apache.org/bugzilla/show_bug.cgi?id=33933

Maybe a comment in the code would have prevented this whole thread  
altogether.  ;-)

~Tom


On Sep 14, 2005, at 10:41 PM, Bill Barker wrote:

> HTTP headers only send times to the second, so yes, to drop off  
> some precision.
>
> ----- Original Message ----- From: "Yaakov Chaikin"  
> <yaakov.chaikin@gmail.com>
> To: <tomcat-dev@jakarta.apache.org>
> Sent: Wednesday, September 14, 2005 8:37 PM
> Subject: Why "/ 1000 * 1000
>
>
> Hi,
>
> While reading the Tomcat's source code, I noticed the following line
> in the service method of the HttpServlet class:
> if (ifModifiedSince < (lastModified / 1000 * 1000))
>
> What's the point of "/ 1000 * 1000"? To drop off some precision?
>
> Thanks,
> Yaakov.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>
>
>
>
>
> This message is intended only for the use of the person(s) listed  
> above as the intended recipient(s), and may contain information  
> that is PRIVILEGED and CONFIDENTIAL.  If you are not an intended  
> recipient, you may not read, copy, or distribute this message or  
> any attachment. If you received this communication in error, please  
> notify us immediately by e-mail and then delete all copies of this  
> message and any attachments.
>
> In addition you should be aware that ordinary (unencrypted) e-mail  
> sent through the Internet is not secure. Do not send confidential  
> or sensitive information, such as social security numbers, account  
> numbers, personal identification numbers and passwords, to us via  
> ordinary (unencrypted) e-mail.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message