Skip Menu |

This queue is for tickets about the libwww-perl CPAN distribution.

Report information
The Basics
Id: 32595
Status: rejected
Priority: 0/
Queue: libwww-perl

People
Owner: Nobody in particular
Requestors: kevin.a.conaway [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 5.808
Fixed in: (no value)



Subject: LWP does not handle responses with no entity body
When sending a PUT request, it is common to not receive an entity body back. LWP::Protocol::http still attempts to read the entity body even though one is not there and thus will die with "read timeout"
LWP needs to behave as prescribed by the HTTP protocol. How can LWP determine when there will not be a body? Is this a specific server's misbehaviour it needs to work-around?
From: kevin.a.conaway [...] gmail.com
On Thu Apr 03 16:27:32 2008, GAAS wrote: Show quoted text
> LWP needs to behave as prescribed by the HTTP protocol. How can LWP > determine when there will not be a body? Is this a specific server's > misbehaviour it needs to work-around?
If the server doesn't send a Content-Length or Transfer-Encoding header, then it is safe to assume that there is no response body
On Thu Apr 03 17:02:57 2008, kevinconaway wrote: Show quoted text
> On Thu Apr 03 16:27:32 2008, GAAS wrote:
> > LWP needs to behave as prescribed by the HTTP protocol. How can LWP > > determine when there will not be a body? Is this a specific server's > > misbehaviour it needs to work-around?
> > If the server doesn't send a Content-Length or Transfer-Encoding header, > then it is safe to assume that there is no response body
The HTTP spec says that it should then read everything until EOF unless it's a 1xx, 204 or 304 reply. The rules for how to determine the response body length are: http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.4 That the method of the request is PUT should not influence anything. I don't understand why the "read until EOF" rule would not do the right thing in your example. Are you able to provide an example program that fails against some public server?