[Zope] Roxen and incorrect Content-Length: header

Bruce Elrick belrick@saltus.ab.ca
Wed, 26 Jan 2000 13:46:46 -0700


Is anyone aware of Roxen+Zope returning incorrect Content-Length: header
information?  I've searched the list archives and found Bill's comment about
Roxen needing to be patched, but it doesn't indicate where the patch comes
from, what the bug is (is it this one?), or what versions of Roxen the bug is
in.

Background:
Linux (RedHat 6.1)
Using roxen-1.3.122-2mdk.i586.rpm from
http://www.ls-la.net/roxen/roxen-1.3.122-2mdk.i586.rpm
(was previously using tar.gz binaries of 1.3.122 from www.roxen.com)
Using Zope 2.1.2 compiled from source.
Using python-1.5.2-7.1386.rpm from Redhat

Set up Roxen according to
magnus: http://www.zope.org/Members/magnus/Roxen
Bill Anderson: http://www.zope.org/Members/Bill/Documentation/RoxenZope

I am able to use Roxen and Zope, but some pages (some but not all with RXML
tags (<gtext>)) get truncated.

If I go directly to Zope, the page has Content-Length: of 4202 bytes:

>>> ZPublisher.Zope('Personnel/WorkWithEmployees/AddEmployeeEmailAddressForm', u='xxxx:yyyy')
Status: 200 OK
X-Powered-By: Zope (www.zope.org), Python (www.python.org)
Content-Length: 4202
Content-Type: text/html
...

If I go the the page with Netscape then look at the page info, the
Content-Length: is 4202 bytes. Looking at the page source, it is truncated. 
Save the page to disk the size of the file is 4202 bytes.

$ ls -l AddEmployeeEmailAddressForm.netscape
-rw-rw-r--   1 belrick  belrick      4202 Jan 26 13:15
AddEmployeeEmailAddressForm.netscape


If I grab the page with wget, the Content-Length: is 4181 but it successfully
downloads 4422 bytes:

$wget --verbose --http-user xxxx --http-passwd yyyy
http://pallas/Personnel/WorkWithEmployees/AddEmployeeEmailAddressForm
--13:28:15-- 
http://pallas:80/Personnel/WorkWithEmployees/AddEmployeeEmailAddressForm
           => `AddEmployeeEmailAddressForm'
Connecting to pallas:80... connected!
HTTP request sent, awaiting response... 401 Unauthorized
Connecting to pallas:80... connected!
HTTP request sent, awaiting response... 200 OK
Length: 4,181 [text/html]

    0K -> ....                                                   [105%]

13:28:15 (308.45 KB/s) - `AddEmployeeEmailAddressForm.4' saved [4422/4181])


If I truncate the file obtained with wget at 4202 bytes and compare it with
the file saved from Netscape, they are identical:
$ dd bs=1 count=4202 if=AddEmployeeEmailAddressForm
of=AddEmployeeEmailAddressForm.wget.trunc
$ diff AddEmployeeEmailAddressForm.wget.trunc
AddEmployeeEmailAddressForm.netscape
(no diff)


I've tried using the --save-header option to wget to see if there is anything
funny in the header and this is what it shows:
HTTP/1.0 200 OK
X-Powered-By: Zope (www.zope.org), Python (www.python.org)
Content-Length: 4181
Content-Type: text/html
Server: Mystery Server/8.7


Now, I can speculate that the difference between the 4202 and 4181 is wget
using HTTP/1.0 and Netscape using HTTP/1.1 (does it?).

What I can't explain is why Roxen does not modify the Content-Length: when it
processes things like <gtext>.  The 4422 bytes that wget successfully
downloads is the entire page.

Cheers...
Bruce
--
Bruce Elrick, Ph.D.                       Saltus Technology Consulting Group
Personal: belrick@home.com                          IBM Certified Specialist
Business: belrick@saltus.ab.ca          ADSM, AIX Support, RS/6000 SP, HACMP