cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: "from memory" chunked upload

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 10 Dec 2005 00:01:57 +0100 (CET)

On Thu, 8 Dec 2005, Benjamin Garrigues wrote:

> Actually, a very simple way (API-wise) would be not to consider
> READFUNCTION's callback returning "0" data read as a "end of transfer"
> anymore, but instead as a "stop perform() execution, without closing the
> connection" (or if it has to much impact on the API because of fread
> returning 0, then do it on -1 return code).

Well, we'd have a specific #define for it and I would assume that it would not
be 0 or -1 but I don't think we need to decide that right now...

> This way, I would be able to continue my main loop to load new data into the
> source buffer and call "perform" once more, until I really end the transfer
> by returning "CURL_ENDOFTRANSFER".

I don't see how we can add it this way without major breakage.

I would rather say that the only "sane" way to implement this would be to
require use of the multi interface. Which by nature returns all the time to
the app.

The problematic case is when you still want to download a file and just pause
the upload since you only want to disable the callbacks/sending for a while
and thus you need to continue calling curl_multi_perform() regularly for the
download and do the magic return from the read callback to pause the upload.
Then you just need a way to unpause the upload and it should be dandy again...

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2005-12-10