cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Curl malloc fails

From: C++ RTMP Server <crtmpserver_at_gmail.com>
Date: Wed, 27 Jun 2012 00:20:43 +0300

Thank you for the response

I will try that and come back with the results.

What about -d -N combination? IMHO, CRLF should be treated like a "flush the output buffer", especially when the input is -
Ok, for --data-binary, there is no way of telling when is the right time for flushing the buffer. Although, a --max-output-buffer-size option would basically take care of everything, including the problem with the huge file:

1. content-length based transfer: just put the content-length: xxxx in the headers (where xxxx is the size of the input) and after that instead of memory buffer all the input, just read at most --max-output-buffer-size bytes and dump them on the pipe
2. Transfer-encoding: chunked (or -N): that naturally forces the chunking to at most --max-output-buffer-size bytes. Same thing: read at most --max-output-buffer-size and dump them on the pipe

Best regards,
Andrei

On Jun 26, 2012, at 11:58 PM, Daniel Stenberg wrote:

> On Tue, 26 Jun 2012, C++ RTMP Server wrote:
>
>> I'm trying to convince curl to do a "Transfer-Encoding: chunked" POST request. Here is what I tried so far:
>
> It is a bit tricky. The -d option doesn't really let you do that (but will always try to read entire thing into memory first and then send it off), but -T does - you just need to "convert" that into a POST instead of PUT.
>
> Something like:
>
> $ cat hugefile | curl -T- -X POST [URL]
>
> --
>
> / 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

------
C++ RTMP Server
Web: http://www.rtmpd.com

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

  • application/pkcs7-signature attachment: smime.p7s
Received on 2012-06-26