cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Problem with CURLE_COULDNT_CONNECT on FTP

From: Jonas Schnelli <jonas.schnelli_at_include7.ch>
Date: Fri, 4 Nov 2011 12:31:23 +0100

>
> Could it also be that there are unclosed FILE * handles?
> I assume that libcurl is not leaking sockets.
>
> It could be anything Linux considers as a file handle (FILE, pipe, socket, etc). libcurl is probably innocent :)
>
> I do a propper curl_global_cleanup after i'm finish with "ALL" transfers.
>
> But maybe the problem is "ALL".
> Because i like to avoid multiple reconnects i keep the "curl_easy session" open by just calling curl_easy_reset before every file transfer.
> I only cleanup after the connection is no longer needen.
> But this should not affect the amount of open sockets?
>
> It depends on the number of "ALL", if it is greater than total allowed soft limit of FDs, then it is a trouble.
>
> I have not used it for years but utilized once, maybe you can use it to further debug. "valgrind" could be of help here. It will tell you the openers of the file descriptors. The option is "--track-fds=<yes|no>".
>
> http://valgrind.org/docs/manual/manual-core.html
>

Thanks Gokhan
Solved the issue.

I had a dummy log where i append some strings to a file.
I never closed the file. /-)
So after writing some log-output there where hundreds of handle to the log open.

lsof -p PID did help me out

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-11-04