diff options
author | Roger Dingledine <arma@torproject.org> | 2002-09-04 06:29:28 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2002-09-04 06:29:28 +0000 |
commit | ddc2b69a282e9ed3378d8e19dbf6bb48c069717a (patch) | |
tree | 36daec41d3e86e9d59f7672819a2b4a301209486 /src/or/config.c | |
parent | 5948f1431c3e2d82589cc936af52a55cfa376cef (diff) | |
download | tor-ddc2b69a282e9ed3378d8e19dbf6bb48c069717a.tar tor-ddc2b69a282e9ed3378d8e19dbf6bb48c069717a.tar.gz |
onion proxies now work (i think)
svn:r96
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/or/config.c b/src/or/config.c index 11839469a..454cd117a 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -188,37 +188,44 @@ RETURN VALUE: 0 on success, non-zero on error } } + if ( options->Role < 0 || options->Role > 15 ) + { + log(LOG_ERR,"Role option must be an integer between 0 and 15 (inclusive)."); + code = -1; + } + if ( options->RouterFile == NULL ) { log(LOG_ERR,"RouterFile option required, but not found."); code = -1; } - if ( options->PrivateKeyFile == NULL ) + if ( ROLE_IS_OR(options->Role) && options->PrivateKeyFile == NULL ) { - log(LOG_ERR,"PrivateKeyFile option required, but not found."); + log(LOG_ERR,"PrivateKeyFile option required for OR, but not found."); code = -1; } - if ( options->ORPort < 1 ) + if ( (options->Role & ROLE_OR_LISTEN) && options->ORPort < 1 ) { log(LOG_ERR,"ORPort option required and must be a positive integer value."); code = -1; } - if ( options->OPPort < 1 ) + if ( (options->Role & ROLE_OP_LISTEN) && options->OPPort < 1 ) { log(LOG_ERR,"OPPort option required and must be a positive integer value."); code = -1; } - if ( options->APPort < 1 ) + if ( (options->Role & ROLE_AP_LISTEN) && options->APPort < 1 ) { log(LOG_ERR,"APPort option required and must be a positive integer value."); code = -1; } - if ( options->CoinWeight < 0.0 || options->CoinWeight >= 1.0 ) + if ( (options->Role & ROLE_AP_LISTEN) && + (options->CoinWeight < 0.0 || options->CoinWeight >= 1.0) ) { log(LOG_ERR,"CoinWeight option must be a value from 0.0 upto 1.0, but not including 1.0."); code = -1; @@ -248,12 +255,6 @@ RETURN VALUE: 0 on success, non-zero on error code = -1; } - if ( options->Role < 0 || options->Role > 15 ) - { - log(LOG_ERR,"Role option must be an integer between 0 and 15 (inclusive)."); - code = -1; - } - return code; } |