PuTTY semi-bug async-dns

This is a mirror. The primary PuTTY web site can be found here.

Home | Licence | FAQ | Docs | Download | Keys | Links
Mirrors | Updates | Feedback | Changes | Wishlist | Team

summary: DNS lookups are synchronous.
class: semi-bug: This might or might not be a bug, depending on your precise definition of what a bug is.
difficulty: fun: Just needs tuits, and not many of them.
priority: medium: This should be fixed one day.

DNS lookups are synchronous. We could make them async quite easily, which would stop the last potential delay before the PuTTY window appears and would also prevent an absent DNS server from hanging PuTTY while a remote-to-local port forwarding times out on DNS; but ideally I'd like an abstraction of DNS so that we can still port later (since the socket API only has synchronous DNS). Porting to Unix will be fine (we can use adns), as will the Mac OS (where almost everything can be asynchronous), and any thread-capable OS won't have a problem. Everything else will just have to degrade gracefully to synchronous DNS.

SGT, 2003-02-07: I now think I have some idea of how to design a DNS abstraction which can cope equally well with being implemented synchronously or asynchronously. It's rather simple, actually: sk_namelookup acquires a couple of extra parameters, in the form of a function pointer and a context handle to be passed to that function. The code which calls sk_namelookup should expect that function to be called in turn on completion of the DNS lookup. Then a synchronous DNS implementation could actually call the function straight from sk_namelookup itself, whereas an asynchronous one could call it from whatever callback ends up getting hold of the results of the lookup. Client code, of course, will have to be written in such a way that it doesn't mind which happens; in practice that will probably mean the function which called sk_namelookup should terminate immediately after doing so, rather than doing anything which might need to be done before or after the DNS lookup.

Patch (unreviewed): Pine.LNX.4.60.0510092209320.31985@maxwell.compbio.ucsf.edu

Audit trail for this semi-bug.


If you want to comment on this web site, see the Feedback page.
(last revision of this bug record was at 2005-10-18 19:31:29 +0000)