cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: WRITEFUNCTION and redirects

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 4 Aug 2003 00:16:18 +0200 (CEST)

On Sun, 3 Aug 2003, Mark Fletcher wrote:

> Here are a few urls:
>
> http://cyberlaw.stanford.edu/lessig/blog/index.rdf
>
> Here's how I initialize the curl handle:

[snip]

> Seen both through the easy and multi interface.
>
> The way I'm dealing with it now is that I record the HTTP status received in
> the header. Then if the WRITEFUNCTION is called when that status != 200, I
> skip it. I've seen this happen with the status code being any number of 3XX.

I think it sounds like a fair work-around.

Thanks for an *excellent* report! Using your code and those URLs I could
repeat this in no time in my own environment, and I could in fact fix this
problem in less than 10 minutes!

It turned out that I had been stupid and forgotten about ignoring that body
contents if the data was sent using chunked transfer-encoding ("normal"
non-chunked data was still being ignored). So, with the attached patch my test
programs seemed to ignore the body contents properly again.

Please let us know if it works for you too!

-- 
 Daniel Stenberg -- curl: been grokking URLs since 1998

-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01

Received on 2003-08-04