cURL / Mailing Lists / curl-library / Single Mail

curl-library

Downloading multipart

From: Daniel Moore <danielxmoore_at_gmail.com>
Date: Tue, 30 May 2006 09:57:39 +1000

(sorry if this is a repeat - I sent the first from an unsubscribed
email, so it shouldn't have made it to the list)

Hi All,

I've just started using libcurl in a project and it's great! Really
easy to use... Anyway, onto the issue at hand :)

I want to download a stream of jpegs from a HTTP camera. I've read
previous emails on the lists indicating that libcurl just gives you
the body of the stream, and at that point you're on your own. I can
see why it works that way and I guess it's fair enough.

However ignoring multipart completely has what I see to be a pretty
big disadvantage. 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.

Which I guess is ok if you want the server push to drive your code
dealing with each part, but I want to go the other way: grab each part
with a call into curl - I can't call back out of curl (at least not
very far).

Any thoughts on this issue? The individual parts of the mime stream
are very like http responses in that they have their own header,
content length and body. It couldn't be too hard to have curl
(optionally) treat them as separate documents...

Thoughts?

--
-----------------------------------------------------
Daniel Moore +61-4-1360-4720
Received on 2006-05-30