How to use "dns_new()" (I get "dns_new: Assertion `(copy->dnsc_flags & DNS_INITED)' failed")

Iñaki Baz Castillo ibc at aliax.net
Sat Feb 5 00:46:26 MSK 2011


2011/2/4 Michael Tokarev <mjt at tls.msk.ru>:
> I'm not sure this makes good sense for a _library_ that's
> using libudns, maybe I just never thought about that.
> Because for a library there's no "default context" per se,
> especially if there will be more than one library used by
> application which uses udns.  So - it looks like - there
> should be a way to call dns_init() more than once (so that
> each library will call it without worrying about multiple
> inits), or there should be a way to determine if udns is
> already initialized (to omit dns_init() call), or dns_new()
> should initialize the library implicitly if it's not already
> inited.
>
> So I'm not really sure where to go from here.  Maybe I'll
> implement all 3 variants - letting multiple dns_init(),
> introducing dns_inited() and letting use dns_copy() before
> dns_init().

Sounds good.


> In any case, this requires a modification, and hence a new
> version.  For now you can assume your code is the only code
> which uses libudns.

My code is in fact a DNS async resolver for EventMachine [*], so when
it's done maybe other projects use udns :)



[*] https://github.com/eventmachine/eventmachine/wiki



-- 
Iñaki Baz Castillo
<ibc at aliax.net>


More information about the udns mailing list