aboutsummaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-07-18 21:47:04 +0000
committerNick Mathewson <nickm@torproject.org>2004-07-18 21:47:04 +0000
commit54c129d8dcbf27ec8f5117b46401a414fafe3b2e (patch)
tree65afe268dae997ef37b63729a68b91bea8aa1e60 /src/or/config.c
parent87d0948903a8ce0802d4b94f98601ededdebd808 (diff)
downloadtor-54c129d8dcbf27ec8f5117b46401a414fafe3b2e.tar
tor-54c129d8dcbf27ec8f5117b46401a414fafe3b2e.tar.gz
abstract ORPort/SocksPort checks into server_mode(), proxy_mode(), clique_mode(), etc. Dont change underlying comments.
svn:r2054
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/or/config.c b/src/or/config.c
index f8e69687a..e5833881e 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -679,22 +679,20 @@ int getconfig(int argc, char **argv, or_options_t *options) {
result = -1;
}
- if (options->ORPort) {
- if (options->Nickname == NULL) {
- if (!(options->Nickname = get_default_nickname()))
- return -1;
- log_fn(LOG_INFO, "Choosing default nickname %s", options->Nickname);
- } else {
- if (strspn(options->Nickname, LEGAL_NICKNAME_CHARACTERS) !=
- strlen(options->Nickname)) {
- log_fn(LOG_WARN, "Nickname '%s' contains illegal characters.", options->Nickname);
- result = -1;
- }
- if (strlen(options->Nickname) > MAX_NICKNAME_LEN) {
- log_fn(LOG_WARN, "Nickname '%s' has more than %d characters.",
- options->Nickname, MAX_NICKNAME_LEN);
- result = -1;
- }
+ if (options->Nickname == NULL) {
+ if (!(options->Nickname = get_default_nickname()))
+ return -1;
+ log_fn(LOG_INFO, "Choosing default nickname %s", options->Nickname);
+ } else {
+ if (strspn(options->Nickname, LEGAL_NICKNAME_CHARACTERS) !=
+ strlen(options->Nickname)) {
+ log_fn(LOG_WARN, "Nickname '%s' contains illegal characters.", options->Nickname);
+ result = -1;
+ }
+ if (strlen(options->Nickname) > MAX_NICKNAME_LEN) {
+ log_fn(LOG_WARN, "Nickname '%s' has more than %d characters.",
+ options->Nickname, MAX_NICKNAME_LEN);
+ result = -1;
}
}
@@ -732,7 +730,7 @@ int getconfig(int argc, char **argv, or_options_t *options) {
/* XXX008 if AuthDir and ClientOnly then fail */
- if(options->SocksPort > 1 &&
+ if(options->SocksPort >= 1 &&
(options->PathlenCoinWeight < 0.0 || options->PathlenCoinWeight >= 1.0)) {
log(LOG_WARN,"PathlenCoinWeight option must be >=0.0 and <1.0.");
result = -1;