cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Fetching More than 500 files from Server

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 13 Jun 2012 12:00:32 +0200 (CEST)

On Wed, 13 Jun 2012, Swamy Mudhbasalar wrote:

> We are try to fetch files from the ESX server 4.0 through HTTP request using
> curl library in C program.

Using which libcurl version? Using which API? On what operating system?

> I am using a single easy curl handle to fetch all the files to take
> advantage of persistent connection. But, When tried to fetch more than 500
> files from the ESX 4.0 using curl library fails.

...

> Each time while fetching a file a new connection is established. So when
> more than 500 connection is established and fetching of files stops. The
> established connections are not getting closed and they remain idle for 30
> mins.

Why is there new ones created and if new ones are created, how come the old
ones are still kept around? That's not something libcurl makes happen. libcurl
tries very hard to re-use connections as much as possible.

> HTTP Client request Sent:
>
> Host: dev-vcenter-4-2
> User-Agent: gSOAP/2.7
> Content-Type: text/xml; charset=utf-8
> Content-Length: 504
> Connection: close
> Cookie:
> vmware_soap_session=C762CF10-B1DF-427A-9E0C-9EB851FFDE3D;$Domain="dev-vcenter-4-2"
> Cookie: ;$Path="/sdk";$Domain="dev-vcenter-4-2"
> SOAPAction: "urn:vim25/4.1"

... "Connection: close" is something you make libcurl send, as it wouldn't
select to send that by itself.

> Connection: close

In which sense is this connection then still "alive" ? How do you see it being
kept in 30 minutes?

I have a hard time to accept this problem description.

> 1. In all HTTP request sent and recieved observed Connection: close ?

That's caused by your program's use of libcurl.

> 2. How to make Connection : Alive and use the same connection to fetch all
> the files? What need to added specificalling in the code to do this ?

HTTP 1.1 doesn't need that header to be persistant, it is so by default!

> 3.Why connections are not getting closed and they remain idle for 30 mins?

You haven't explained with enough details for us to understand what exactly
you're seeing and how you're using libcurl so this really isn't possible to
answer to without a lot of guessing.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-06-13