cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Problem with Location header redirect

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 2 Dec 2006 22:21:57 +0100 (CET)

On Sat, 2 Dec 2006, Dobromir Velev wrote:

> I also noticed that there is no Conent-length header and it is what is
> causing the problem. I'm now trying to add a workaround in lib/transfer.c to
> avoid the timeout error for this particular case.

Any ideas on how you'd do that? In HTTP there is basically three ways for a
client to know when the response is done: 1) connection closed 2)
Content-Length 3) chunked encoding. The response you got had none of these so
a client has no means to know where/when it stops.

Since a response body MUST be preceeded with enough info for a client to know
the end of it, the change below is now in CVS:

http://cool.haxx.se/cvs.cgi/curl/lib/transfer.c.diff?r1=1.319&r2=1.320

... and using this, libcurl would not read the response you got and it
wouldn't hang like this. However, I'm not saying it is the perfect solution
for your case since one bad response is usually followed by other protocol
weirdos.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2006-12-02