I did this
I have an application running on Free BSD on a i386 machine.The application wakes up every 10 seconds and tries to do a curl_easy_perform() .
1-At the beginning , I don't have the DNS server config on my system , hence curl_easy_perform fails (ON DNS resolution) .
However curl_easy_perform() keeps failing for the DNS resolution.
nsswitch.conf - name service switch configuration file
passwd: files sdk
I expected the following
The text was updated successfully, but these errors were encountered:
I presume this is built to use the stock resolver synchronously or threaded? (you didn't answer the question for curl -V output). While you're using a fairly old libcurl version, I don't think this issue has been addressed in the many releases after yours.
As a work-around, can you try calling
Thanks for the quick response !!
I tried the suggested workaround and it seems to be working fine after that .
Kindly advise .
Yes, I think that's an excellent work-around. Ideally curl should do that
Also if I remove it as such each curl_easy_perform() invocation opens up a socket and don't close it eating up the file descriptors causing the same problem .The below stack trace suggests the path in which the socket is created
Breakpoint 1, 0x28ffa98c in socket () from /usr/lib/libc.so.6
Here's the fstat o/p showing the fd consumption with just the easy_perform without the res_init
fstat -p 43722
fstat -p 43357 >>> this is with res_init
root connect-app 43357 11* kqueue pending_events:0
My application is calling curl_easy_perform in a loop every 10 seconds till it succeeds .So this builds up really fast .I noticed if no DNS servers are configured in the system , this does not happen .But if the DNS server(s) are configured but still the address resolution keeps failing , I see the above issue .Please help !
Thanks & Regards