control interface via unix domain socket

Nick Mathewson nickm at freehaven.net
Tue Jun 5 00:36:47 UTC 2007


On Mon, Jun 04, 2007 at 08:58:00PM +0200, Peter Palfrader wrote:
> Hi,
> 
> this is a first cut at a patch to also offer the control interface over
> a unix domain socket, not just a TCP port.
> 
> Things that remain to be done:
>  - make relative filenames relative to datadir?
>  - document in manpage
> 
> Please let me know if this is something that should go in, and if yes
> how to change it so that it can.

This should go in.  Here are a few comments about what should/could
get changed.

  - Right now, your code rejects the ControlSocket option as
    unrecognized.  if the code can't support it.  That's not how we
    handle unsupported options right now; instead, we try to give a
    message that says, "this Tor can't support that (otherwise valid)
    option."  (In some cases, we just ignore the option.  That's bad
    too.)

  - Make sure your code passes "make check-spaces".

  - I'm not sure we need to have a new listener type for this.
    I think, instead, that connection_create_listener should
    take a "struct sockaddr" as its argument, and that its callers
    should pass it a sockaddr of the right kind.  This will avoid
    bloating connection_create_listener, and will make the eventual
    IPv6 listeners easier too.

    To handle the special-cases on AF_UNIX later on, we could add a
    one-bit is_unix_socket flag to connection_t.

  - I think you missed the code to make connection_is_listener() work,
    in case you don't go with the above.

With that in mind, this looks pretty close to complete.  Would you
like to do the cleanup, or should I?

yrs,
-- 
Nick Mathewson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: not available
URL: <http://lists.torproject.org/pipermail/tor-dev/attachments/20070604/9e975f5d/attachment.pgp>


More information about the tor-dev mailing list