cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: bug: afert redirect, the content length is not reset

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Wed, 10 Dec 2008 08:39:11 -0800

On Wed, Dec 10, 2008 at 06:04:24PM +0800, �� wrote:
> Dear Dan:
> Get content-length from body write callback is useful. Like response
> code, body write callback can do some actions according the content-length
> value. If body transfer completes, the length can from write count and
> content-length is little useful. In ther other hand, running into the body
> write callback means the header transfer and parse end.
> Thanks very much.

But there's no way to get the content length in a chunked transfer until the
end, no matter how handy it is. What you can do, since you're in the write
callback anyway, is to count the data as it comes through yourself. But
it's impossible to know much data will be coming. Chunked transfers are
intended for the situation where the server has no idea how much data will
be available, after all.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2008-12-10