[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: TODO: Add a way to request DNS resolves from the controller



On Mon, Jul 02, 2007 at 10:55:09PM +0100, Robert Hogan wrote:
> On Monday 02 July 2007 22:21:12 Robert Hogan wrote:
> > On Wednesday 27 June 2007 17:20:06 Nick Mathewson wrote:
> > <snip>
> >
> > > I think the approach you describe above is okay.  It shouldn't break
> > > backward compatibility, since preexisting controllers will never issue
> > > RESOLVE commands, and so will never get "650 RESOLVE" events.
> >
> > Hi Nick,
> >
> > Patch attached. It supports host and reverse lookups.
> >
> > Sample output:
> >
> > resolve hotmail.com
> > 250 OK
> > 650 RESOLVE hotmail.com:64.4.32.7
> > resolve 64.4.32.7
> > 250 OK
> > 650 RESOLVE 64.4.32.7:lc1.bay0.hotmail.com
> >
> > Let me know what needs cleaning up/reworking.
> 
> For a start it didn't handle unknown hostnames, or any other error conditions. 
> Nor did it respect the indentation in dnsserv.c. The attached does.
> 
> I haven't included a write-up for controlspec.txt.

Almost there, and generally quite nice.

These issues remain, though:
  - As written, if there's more than one controller that uses the
    RESOLVE command, all of them are informed whenever _any_ of them
    gets a "650 RESOLVE".  (This is the big one, the rest are cosmetic
    and easy to fix.)

  - Using a new socks command isn't right here: this isn't new
    functionality.  Instead, it would probably be best to add a bit to
    the edge_connection_t struct.

  - evdns_server_control() is almost entirely cut-and-pated code.
    That's bad.  Common code should be in a function.

  - The evdns_* prefix is reserved for functions in evdns.c.

  - The handle_control_* prefix is for handling control commands from
    a controller.

I'll try to fix this stuff and check in the feature later today.
Please let me know if you'd rather do it yourself.

peace,
-- 
Nick Mathewson

Attachment: pgpr9meVJEATy.pgp
Description: PGP signature