cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: curl (win32) fails to upload binary data from stdin

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 7 Jun 2015 22:52:09 +0200 (CEST)

On Sun, 7 Jun 2015, Jan Dostrasil via curl-users wrote:

> But I'll have to use TEMP file anyway, because curl does not read from pipe
> as I have expected. With tar and gpg the data are really piped on the fly
> (data are passed byte by byte), but curl waits for all the data from a pipe
> (eating memory at the size of the upload) and starts uploading after it has
> all the data, which makes it resource hungry and the pipe ineffective. I
> wanted to upload on the fly. Avoiding the file in the middle would make it
> faster and lower disk wear and tear, but it is not effective at the cost of
> memory :-( Is it because curl needs to know the size of upload prior
> posting?

Yes, but that's not the primary reason as it could most often do an "upload"
without knowing the size.

It could technically very well do the upload in a "streaming" manner (for most
cases) if we would just adapt the code to do so. The current way is done to
keep the code easy and simple. And because nobody ever made it any different.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2015-06-07