cURL / Mailing Lists / curl-library / Single Mail

curl-library

Filedescriptor leak with curl_multi_socket API (CLOSE_WAIT)

From: Pedro Larroy <pedro.larroy_at_gmail.com>
Date: Fri, 23 Feb 2007 07:14:10 +0100

Hello

I'm using the curl_multi_socket API (debian's 7.15.5-1) with epoll for a
university research project, and I have noticed a filedescriptor leakage
using it. Perhaps I'm not using the api correctly, since it's a little
tricky to get it right. When I recieve CURL_POLL_REMOVE I got epoll errors
because apparently the fd was beeing already closed by curl, and thus
removed of the epoll socket.

I currently do nothing with CURL_POLL_REMOVE, but I have noticed that
connections are left in CLOSE_WAIT state indefinitely. My question is that
if this is my fault or is there a bug in curl. I have solved it temporarily
by doing an easy_cleanup on the easy handle for each reuse of the easy
handle, since I aimed for reusing the easy handlers over and over by
setting new urls.

Any hints appreciated. Regards.

-- 
Pedro Larroy Tovar, pedro at larroy dot com | http://pedro.larroy.com/
  * Las patentes de programación son nocivas para la innovación *
               http://proinnova.hispalinux.es/
Received on 2007-02-23