cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Downloading multipart

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 1 Jun 2006 08:46:48 +0200 (CEST)

On Thu, 1 Jun 2006, Daniel Moore wrote:

> Then read data & send it back to CURLOPT_WRITEDATA as usual, but watch for
> either the appropriate number of bytes received (content-length) or for the
> multipart boundary. When the end of the part is detected, return from
> curl_easy_perform, having stashed away any remaining data read from the
> stream.
>
> At this stage, we've read the first part of a multipart in a single call to
> curl_easy_perform, and returned to the caller.

I could agree to most of what you said until this point. Having
curl_easy_perform() return before the entire request is complete would
introduce a huge can of worms as that is not how curl_easy_perform() behaves
today. I would say that it should continue spitting out parts to the callback
as long as the stream is alive. It would of course also require some sort of
separating info/callback to the app when one part is completely transfered.

If you'd want to get back "control" and do something else before allowing
another multipart, you'd instead use the multi interface as it would then
provide such a feature "automatically".

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2006-06-01