cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: multiple URL in command lines means pipelining?

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Sat, 23 Aug 2008 12:05:20 -0700

On Sat, Aug 23, 2008 at 05:14:29PM +0000, hgiuh ghj wrote:
>
> I have a question about putting multiple URLs in the curl command line.
>
> If I execute curl http://example.com/ http://example.com/footer.jpeg (Assuming that footer.jpeg is the part of the index.html's example.com code)
>
> What is the behavious of curl ?
>
> Does he send 2 requests at the same time without waiting for any reply from the server (pipelining)

Even though libcurl supports pipelining, curl the command-line tool doesn't
use it.

> Does he send the request for http://example.com, waits for the reply, then request the http://example.com/footer.jpeg's request (multi requests over the same TCP connection) ?

This last one is what it does.

> Does he opens 2 TCP connections for a request/reply pair (multi requests over multi TCP connections ?

As long as the server leaves the connection open, curl will reuse it.

> If I want to imitate the behavious of a common browser, which command have I to use :
>
> curl http://example.com/ http://example.com/footer.jpeg ?
> curl http://example.com/ & http://example.com/footer.jpeg ?
> curl http://example.com/ ; curl http://example.com/footer.jpeg ?

Depending on the browser and other conditions, the first or last would be
closest (the middle one is invalid). These days, I imagine most browsers
would use pipelining, though.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2008-08-23