httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <jor...@redhat.com>
Subject Re: 2.0.59: ETag mtimes on 32- and 64-bit machines
Date Fri, 31 Aug 2007 11:57:05 GMT
On Fri, Aug 24, 2007 at 04:32:32PM +0100, Mark Drayton wrote:
...
> Issue #40064 has a patch for Apache 2.2 which changes etag_ulong_to_hex() to
> etag_uint64_to_hex() and avoids casting the mtime to an (arch-dependent)
> unsigned long. We can't move to 2.2 at the moment so instead I patched
> 2.0.59 with the same changes (diff below -- note 2.2.x moved this code out
> to http_etag.c). Initially it didn't work -- the 32-bit machine still
> returned a truncated ETag. I fixed it with (in etag_uint64_to_hex()):
> 
> -    int shift = sizeof(unsigned long) * 8 - 4;
> +    int shift = sizeof(apr_uint64_t) * 8 - 4;
> 
> Is this right? I'm not a C programmer but it seems right to me: without this
> change etag_uint64_to_hex() only converts the low 32 bits (ie, length of an
> unsigned int on a 32-bit machine). So now I have:

Yes, that's correct - this was fixed in Subversion exactly as you 
describe:

http://svn.apache.org/viewvc?view=rev&rev=517238 (initial patch)
http://svn.apache.org/viewvc?view=rev&rev=517654 (corrected)

I've added a note to this effect to the bug report.

joe


Mime
View raw message