[Catalyst] p-static-simple line-ending patch

Carl Franks fireartist at gmail.com
Fri Feb 24 13:49:24 CET 2006


On 23/02/06, A. Pagaltzis <pagaltzis at gmx.de> wrote:

> This smells very wrong to me. I've never had any issues with
> either type of line ending in any other scenario. I suspect that
> what's really happening is that the Content-Length header of the
> response, which gets set a few lines above code you patched,
> disagrees with the actual length of the body. This is just a
> hunch though, and I can't test it where I am right now.

You're right.
I've since discovered that the ends of catalyst-generated html pages
are getting cut.
It doesn't happen under the script/test.cgi server, only under apache.
It's not a browser issue, because it also happens when I retrive the
html with wget.

If I use wget's --ignore-length flag, the html isn't cut.

This is the command that created the attachment 4.response
I used the -s flag to save the http headers.


>wget -O 4.response -s http://192.168.0.1/cdiary/group
events/1
--12:13:17--  http://134.36.192.160/cdiary/groupevents/1
           => `4'
Connecting to 134.36.192.160:80... connected.
HTTP request sent, awaiting response... 200
Length: 4,812 [text/html]

100%[====================================>] 4,812          4.59M/s    ETA 00:00

12:13:19 (4.59 MB/s) - `4.response' saved [4812/4812]


This is the command that created the attachment 4.response
I used the -s flag to save the http headers.

I also commented out the line in Catalyst.pm that sets the content_length
#$c->response->content_length( bytes::length( $c->response->body ) );


>wget -O 5.response -s http://134.36.192.160/cdiary/group
events/1
--12:13:29--  http://134.36.192.160/cdiary/groupevents/1
           => `5'
Connecting to 134.36.192.160:80... connected.
HTTP request sent, awaiting response... 200
Length: unspecified [text/html]

    [ <=>                                 ] 4,832          4.61M/s

12:13:33 (4.61 MB/s) - `5.response' saved [4832]


Below is a diff of the 2 responses. (both of which are attached)
You can see that the first has a keep-alive line, and the 'connection'
headers are different.
After looking at the catalyst source, I'm assuming those 2 header
lines are being set by apache.

>diff -U 1 4.response 5.response
--- 4   Fri Feb 24 12:13:19 2006
+++ 5   Fri Feb 24 12:13:33 2006
@@ -1,8 +1,6 @@
 HTTP/1.1 200
-Date: Fri, 24 Feb 2006 12:13:17 GMT
+Date: Fri, 24 Feb 2006 12:13:29 GMT
 Server: Apache/2.0.55 (Win32) PHP/4.4.1
 X-Catalyst: 5.64
-Content-Length: 4812
-Keep-Alive: timeout=15, max=100
-Connection: Keep-Alive
+Connection: close
 Content-Type: text/html; charset=utf-8
@@ -26,2 +24,4 @@
 </div>
-</div>
\ No newline at end of file
+</div>
+</body>
+</html>


I'm running apache 2.0.55 on win xp.

I can't draw any conclusions from this. Any ideas?

Cheers,
Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 4.response
Type: application/octet-stream
Size: 5026 bytes
Desc: not available
Url : http://lists.rawmode.org/pipermail/catalyst/attachments/20060224/0a5411de/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 5.response
Type: application/octet-stream
Size: 4985 bytes
Desc: not available
Url : http://lists.rawmode.org/pipermail/catalyst/attachments/20060224/0a5411de/attachment-0001.obj 


More information about the Catalyst mailing list