cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Downloading multipart

From: Robson Braga Araujo <robsonbraga_at_gmail.com>
Date: Tue, 30 May 2006 01:11:58 -0700

> > Sure you can interpret the mime & content lengths and everything from the
> > CURLOPT_WRITEFUNCTION and get what you want, but you have to decode the
> > entire stream in the context of a single call to curl_easy_perform.
>
> How else would it work? You get a stream passed to your callback. Your
> callback gets the contents and decode it as it see fit.

I think he means using libcurl as callback instead of having his code
being a callback to libcurl. The only way to do it is to use the multi
interface. Create a function called read_from_network or something
similar. Have this function call curl_multi_perform until you have
enough data and then return. This way you can use this function as a
callback inside your code to decode mime.

-- 
[]s,
Robson
   I don't need to compromise my principles, because they don't have the
slightest bearing on what happens to me anyway.	  -- Calvin
Received on 2006-05-30