cURL / Mailing Lists / curl-library / Single Mail


DNS look up will always fail, if thread is started with network cable disconnected.

From: Henrik Heino <>
Date: Fri, 20 May 2011 11:38:22 +0300


I'm using libcurl with easy interface in a multithreaded program. The system
is FreeBSD and libcurl version is 7.20. I have noticed strange problem in
the following case: I boot computer without network cable connected. Then I
start my program and it starts some threads. After some time, I fix the
network cable problem by connecting it.

Now the computer has again connection to network, but all the threads that
are started before connecting network cable, will keep failing with DNS look
up. They might also fail with other network activity too, but currently I'm
stuck with the phase where libcurl does DNS look up.

Those threads, that are started after network cable is connected and system
connects to network, are running just fine. So eventually, I'm in situation
where half of threads keep complaining about failing DNS and others work as

I also tried this in Linux with libcurl 7.21. The problem did not occure
there, so this may be FreeBSD-problem. If you want to test this by yourself,
the code of simple test program can be found here: The same source can also be found
from so if you like to look at it, you don't
have to extract any packages.

But anyway, do you have any idea what I'm doing wrong?

-- Henrik Heino

List admin:
Received on 2011-05-20