curl-users
Re: curl (win32) fails to upload binary data from stdin
Date: Sun, 07 Jun 2015 22:33:12 +0200 (CEST)
On Thu, 04 Jun 2015 Gisle Vanem <gvanem_at_yahoo.no> wrote:
> I think curl, i.e. src/tool_binmode.c already does this. Hard to tell if it
> does it for stdin though. The call to set_binmode() is in tool_operate.c.
> Why don't you upload via a TEMP-file instead?
Apparently it doesn't set binary mode at least for stdin on windows builds.
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?
-------------------------------------------------------------------
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