diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-10-09 20:44:47 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-10-09 20:44:47 +0000 |
commit | 8b71a76dd322ab0043871cac3c299cd660471121 (patch) | |
tree | 3e81cd2444e9335ec592a5b70725fb43d40a734f /src/or/router.c | |
parent | 010fd50c365f90f98e9e8ec243a573aba4c53cfa (diff) | |
download | tor-8b71a76dd322ab0043871cac3c299cd660471121.tar.gz tor-8b71a76dd322ab0043871cac3c299cd660471121.zip |
r15598@catbus: nickm | 2007-10-09 16:37:35 -0400
Turn all "Is DirPort nonzero? Because if it is, we must be a directory" logic into calls to dirserver_mode().
svn:r11817
Diffstat (limited to 'src/or/router.c')
-rw-r--r-- | src/or/router.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/or/router.c b/src/or/router.c index 073d2e17da..78a158a587 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -854,6 +854,14 @@ server_mode(or_options_t *options) return (options->ORPort != 0 || options->ORListenAddress); } +/** Return true iff we are trying to be a directory server */ +int +dirserver_mode(or_options_t *options) +{ + if (options->ClientOnly) return 0; + return options->DirPort != 0; +} + /** Remember if we've advertised ourselves to the dirservers. */ static int server_is_advertised=0; @@ -879,7 +887,10 @@ set_server_advertised(int s) int proxy_mode(or_options_t *options) { - return (options->SocksPort != 0 || options->SocksListenAddress); + return (options->SocksPort != 0 || options->SocksListenAddress || + options->TransPort != 0 || options->TransListenAddress || + options->NatdPort != 0 || options->NatdListenAddress || + options->DNSPort != 0 || options->DNSListenAddress); } /** Decide if we're a publishable server. We are a publishable server if: |