DNS server update causes problem #2251
Comments
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 !! libcurl/7.43.0 OpenSSL/1.0.2k 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 |
Thank you so much !!! Really appreciate the help ,I will go ahead and add this in my application . |
This issue is now mentioned in the TODO to make it possible for others to find and help out with. It is not going to be fixed in the short term so this issue is hereby closed. Thanks for the report! |
Is it also suitable for mobile devices? Using libcurl |
I'm not sure what you're asking or how it relates to this issue. If you have a question please ask it on the mailing list and be sure to give us as much detail as possible. |
Hi , 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 |
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) .
2- Now I added the DNS server config and after that ping/host command etc works on that domain name
ping google.com
PING6(56=40+8+8 bytes) :: --> 2404:6800:4003:804::200e
host google.com
google.com has address 172.217.160.14
However curl_easy_perform() keeps failing for the DNS resolution.
The problem resolves only when I restart my application after adding the DNS server configuration on the system .
Please note I have not done curl_global_cleanup() on failure , hence curl_global_init() won't be done on every attempt .I am wondering if that causes some missing initializations with respect to DNS as the DNS server config was missing when curl_easy_init() (and hence implicit curl_global_init() ) was done for the first time .
cat /etc/nsswitch.conf
nsswitch.conf - name service switch configuration file
$Id:$
passwd: files sdk
Code
I expected the following
curl/libcurl version
7.43.0
[curl -V output]
operating system
FreeBSD 6
The text was updated successfully, but these errors were encountered: