cURL / Mailing Lists / curl-users / Single Mail

curl-users

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

From: Gisle Vanem <gvanem_at_yahoo.no>
Date: Thu, 04 Jun 2015 17:14:09 +0200

Jan Dostrasil via curl-users wrote:

> I think that someone should add something like the following to curl source
> (at least this is what I used in main() with old borland c compiler long time
> ago):
>
> #if defined( DOS ) || defined( _WIN32 )
> if ( setmode( fileno(stdin), O_BINARY ) == (-1) || setmode( fileno(stdout),
> O_BINARY ) == (-1) ) {
> perror( "warning: failed to set binary mode for stdin/out" );
> }
> #endif

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?

-- 
--gv
-------------------------------------------------------------------
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-04