curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: Request: flag for delayed start of HTTP until STDIN sends EOF

From: Rudy via curl-library <curl-library_at_cool.haxx.se>
Date: Mon, 30 Oct 2017 10:25:55 -0700

On 10/10/2017 02:06 AM, Erik Johansson wrote:
>
> On 9 October 2017 at 19:17, Rudy via curl-library
> <curl-library_at_cool.haxx.se <mailto:curl-library_at_cool.haxx.se>> wrote:
>
> Goal:
> slow_script.pl <http://slow_script.pl> | curl
> "-FmyUpload=@-;filename=foo.txt" --wait-for-eof-for-upload
> https://user:pass@haxx.se/upload.php
> <https://user:pass@haxx.se/upload.php>
>
>
> Or install moreutils and use sponge.
> slow_script.pl <http://slow_script.pl> | sponge | curl ...

That doesn't work as items in the pipeline are all executed
simultaneously. (Curl starts before sponge finishes.)

EXAMPLE$ date > date1 | sleep 10 | date > date2
EXAMPLE$ cat date*
Mon Oct 30 09:41:42 PDT 2017
Mon Oct 30 09:41:42 PDT 2017

This would work if curl didn't initiate HTTP until first piece of data
gets send. Maybe a '=FmyUload=@-' should cause curl to wait for at
least one byte (different, but similar, to waiting for EOF).

Rudy
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2017-10-30