RE: Use of 1*DIGIT

Justin Erenkrantz said:
> On 12/21/06, Travis Snoozy (Volt) <a-travis@microsoft.com> wrote:
> > Anyone know how Apache handles this, off the top of their heads? Squid?
> > Other servers? Clients?
>
> httpd 2.2 and newer parses incoming Content-Length as an off_t which
> if LFS is enabled is 64-bit, otherwise, it'd be 32-bit.  (Almost all
> modern platforms are LFS-enabled these days.)  1.3 and 2.0 use 'long'.
>
>http://svn.apache.org/repos/asf/httpd/httpd/trunk/modules/http/http_filters.c
>
> See the call to apr_strtoff() there.

Ah; thank you! So, half of my guess was right, and the other half was wrong: the most widely-used server on the 'net does not use bignums here, but the code DOES consider the overflow condition (in the case of content-length, at least). The underlying functions (strtol/strtoi) are also specified to saturate, as opposed to wrap, so that's a plus, too.

Can anyone clue me in on Firefox?


Thanks again,

-- Travis

Received on Friday, 29 December 2006 21:04:24 UTC