cURL / Mailing Lists / curl-library / Single Mail


Re: receive chunked data from http server via curl_easy_perform( )

From: Jerry G. Chiuan <>
Date: Mon, 9 Feb 2004 16:22:38 -0800

> > When we use curl_easy_perform( ) to get chunked data from http server,
is it
> > possible to know the *total chunked data's length* before callback
> > (CURLOPT_WRITEFUNCTION) starts to be invoked?
> > ( ps: in this case, "Transfer-Encoding: chunked" header field is used in
> > header of http response from server)
> >
> > Or, I can't know the length of total chunked data until libcurl finishes
> > parsing it and curl_easy_perform( ) gets returned
> The whole point of chunked data is that it is for those occasions when the
> server doesn't know the total length of the data (e.g. when it is
> dynamically). If the server doesn't know, then you can't know either.
> >>> Dan

thanks Dan,
So I can't avoid to renew my buffer and delete my old one since the length
can't be predicted before I new it for first time
Once I find my buffer's length is not enough, I have to new another one and
delete the old one ~~

- Jerry
Received on 2004-02-10