cURL / Mailing Lists / curl-users / Single Mail

curl-users

curl waits for stdin to "EOF" before firing requests when "-K -" is used to read config from stdin

From: Xavier !! via curl-users <curl-users_at_cool.haxx.se>
Date: Tue, 15 Dec 2015 17:16:43 +0000 (UTC)

Hello curl-users,
With "-K -" used to read the config from the stdin, curl waits until no more input comes from stdin, and then executes all the HTTP requests 
Ex : Requests will wait (3*3) 9 seconds before being sent 
for i in {1..3}; do   echo "url = http://127.0.0.1/$i";  sleep 3;done | curl -vK - 
Is there any way to avoid that and make curl execute each request as soon as they are coming from stdin ?

I tried to use "next' to force curl to separate operations, and fire requests immediately, but with no luck
Ex : Requests will still wait (3*3) 9 seconds before being sent 
for i in {1..3}; do   echo "url = http://127.0.0.1/$i";  echo "next";  sleep 1;done | curl -vK - 
When dealing with a large stream of config input sent to the curl stdin, it could be helpful/more performant to execute each request without waiting for all of them to be "computed"
(For performance reasons, we sometimes want/need to keep connexions opened and re-use existing connection : Executing curl n times is not an option in this situation)

Did I miss something, or is there really no way to achieve that in the current version ?Is this "just" not implemented or is there any reasons that would make such a behaviors impossible ?

Regards,
Xavier

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