cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: file descriptors leak

From: Bertrand Demiddelaer <bdemiddelaer_at_denyall.com>
Date: Thu, 07 Oct 2004 13:59:39 +0200

Chih-Chung Chang wrote:
> The following program prints "res=0" at first,
> but after about 1000 lines it begins to print
> "res=37" (CURLE_FILE_COULDNT_READ_FILE).
> It seems each call to curl_easy_perform leaks
> one file descriptor?

I tested your program against a recent libcurl (daily snapshot 20041004)
and didn't have this problem.

Which libcurl version do you run ? What's your OS ?

> -----
> #include <stdio.h>
> #include <curl/curl.h>
> int main()
> {
> CURL *curl = curl_easy_init();
> curl_easy_setopt(curl, CURLOPT_URL, "file:///dev/null");
> while(1)
> {
> CURLcode res = curl_easy_perform(curl);
> printf("res=%d\n",res);
> }
> curl_easy_cleanup(curl);
> return 0;
> }
> -----
> Thanks,
> Chih-Chung Chang
>
Received on 2004-10-07