Forum Moderators: phranque

Message Too Old, No Replies

apache reporting wrong content-length

         

pjfvenice

6:53 pm on Nov 28, 2005 (gmt 0)

10+ Year Member



I'm running Apache 1.3.34 with LFS (large file support) on rhel 3.

It looks like files over 2G are reporting the wrong content-length.

Example: For a 2.3G file:
Content-Length: -1873404198

It should be

Content-Length: 2421563098

Am I missing something here?

jdMorgan

5:06 pm on Nov 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



pjvenice,

Welcome to WebmasterWorld!

Yes, it's a matter of how your system expresses decimal numbers when converting from binary/hexadecimal numbers.
With the overflow over the 2-gig boundary, your system is assuming that the most-significant bit being set to '1' means that it is a negative number (this is a standard way of doing it in fixed-point ones-complement binary arithmetic operations).

You could test for this, and simply subtract any negative number you get from 4294967296, and the result will be the correct positive number.


Decimal .... Hexadecimal
4294967296 . 100000000
-1873404198 . -6fa9e126
----------- . ---------
2421563098 .. 90561eda

Jim