[CCing [EMAIL PROTECTED] with permission]

Darin Fisher wrote:

> Doug Turner wrote:
>
>> Darin Fisher wrote:
>>
>>> Yes, I agree (sort of).  I don't think other threads will be calling 
>>> res_init, but other threads might call gethostbyname while _the_ DNS 
>>> thread is calling res_init, which might be an issue (see for example 
>>> nsDNSService::Resolve).  Resolve is called by a socket transport 
>>> when opening a blocking input or output stream (IMAP opens blocking 
>>> output streams, I think... or does it now use AsyncWrite... hmm).  
>>> PAC also calls Resolve, which is triggered via preferences.
>>
>> Ick!
>>
>> Why can't we queue this dns request and block the caller of Resolve()?
>
> we certainly could do that, and maybe we should?!
>
> what about the LDAP SDK... does it call gethostbyname? 

The C SDK does call gethostbyname.  However, since that can potentially 
block, the XPCOM SDK (and thus the client) instead goes out of its way 
to call nsDNSService::Lookup() and then wait for a callback.  Then the 
pre-resolved address is handed into the C SDK, and doing gethostbyname 
on an IP address won't block.

It would be helpful to have a bit more context here....

Thanks,
Dan



Reply via email to