cURL / Mailing Lists / curl-library / Single Mail

curl-library

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

From: Henrik Heino <henrik.heino_at_varaani.com>
Date: Mon, 23 May 2011 09:48:01 +0300

2011/5/20 Dan Fandrich <dan_at_coneharvesters.com>

> On Fri, May 20, 2011 at 02:02:51PM +0200, Ben Noordhuis wrote:
> > On Fri, May 20, 2011 at 10:38, Henrik Heino <henrik.heino_at_varaani.com>
> wrote:
> > > 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.
> >
> > Henrik, does your FreeBSD libcurl use c-ares or libc as the resolver?
>
> If libc, does calling res_init() from the app after the network cable is
> connected solve the problem?
>
> >>> Dan
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>

It uses libc, and it seems res_init() fixes the problem. Thanks! :)

Although I tried it before, and that time it didn't help, but maybe I called
it in wrong thread. Now I put it to same thread where curl is being ran.

-- Henrik

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-05-23