cURL / Mailing Lists / curl-library / Single Mail

curl-library

FW: Problem reusing ftp connections

From: Cadime <ricardo-v-cadime_at_ptinovacao.pt>
Date: Thu, 22 May 2003 19:14:56 +0100

Dear CURL'ers

I am having a memory leak at libcurl.

I am doing several NLST to an FTP server that replies with a "550 No files
found"
I think this is not a valid answer, right?

Anyway, in this case, as I am trying to re-use connections, I was able to
see that sockets were not closed and I run out of file handles, after a
while...

Here is my environment:
FTP client using libcurl curl-7.10.5 on HPUX 11
FTP server "ProFTPD 1.2.2rc1 Server"
ftpget.c in annex (customized example)

some tcp sockets weren't closed...

I already test my code against Microsoft W2K FTP server and it worked fine.
Then I checked the NLST answer and saw this difference!!!

Anyone can help me?
I was not able to compile my code as in README.memoryleak (HPUX ???)
I am not an expert on CURL, either...

Thanks
Ricardo Cadime

-----Original Message-----
From: Daniel Stenberg [mailto:daniel_at_haxx.se]
Sent: quarta-feira, 11 de Dezembro de 2002 13:20
To: libcurl Mailing list
Subject: Re: Problem reusing ftp connections

On Wed, 11 Dec 2002, Cadime wrote:

> I was trying to reuse connections and I got a strange behaviour.
>
> I do the following sequence of commands several times:
> a) list remote files of a known extension
> b) reuse connection to get each file individually.
> c) close connection ( curl_easy_cleanup )
>
> After a while I am reaching the maximum number of open sockets for my
> process and I am not able to open a new one.
>
> If I do not reuse the connections, everything is OK.

This certainly sounds as if there is a file handle leak.

Please follow the few simple steps outlined in the README.memoryleak
document
(online here: http://curl.haxx.se/lxr/source/lib/README.memoryleak) in order
to verify/track this down.

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility 
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/

-------------------------------------------------------
This SF.net email is sponsored by: ObjectStore.
If flattening out C++ or Java code to make your application fit in a
relational database is painful, don't do it! Check out ObjectStore.
Now part of Progress Software. http://www.objectstore.net/sourceforge

  • application/octet-stream attachment: ftpget.c
Received on 2003-05-22