diff options
author | Roger Dingledine <arma@torproject.org> | 2011-09-11 01:33:04 -0400 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2011-09-11 01:33:04 -0400 |
commit | cca806c56c4b14462a610eaa835db8d081d27c14 (patch) | |
tree | f67a60927d8a40128676de20c99b9ad0cb14bad8 /src/or/config.c | |
parent | a8838a86fe97b95afc075596339302ae8e0948be (diff) | |
download | tor-cca806c56c4b14462a610eaa835db8d081d27c14.tar.gz tor-cca806c56c4b14462a610eaa835db8d081d27c14.zip |
fix whitespace (two-space indent)
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 87 |
1 files changed, 44 insertions, 43 deletions
diff --git a/src/or/config.c b/src/or/config.c index ac7c6fff7e..bc77b3a77e 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -4980,56 +4980,57 @@ parse_client_port_config(smartlist_t *out, /* FooListenAddress is deprecated; let's make it work like it used to work, * though. */ if (listenaddrs) { - int mainport = defaultport; + int mainport = defaultport; - if (ports && ports->next) { + if (ports && ports->next) { log_warn(LD_CONFIG, "%sListenAddress can't be used when there are " "multiple %sPort lines", portname, portname); return -1; - } else if (ports) { - if (!strcmp(ports->value, "auto")) { - mainport = CFG_AUTO_PORT; - } else { - int ok; - mainport = (int)tor_parse_long(ports->value, 10, 0, 65535, &ok, NULL); - if (!ok) { - log_warn(LD_CONFIG, "%sListenAddress can only be used with a single " - "%sPort with value \"auto\" or 1-65535.", portname, portname); - return -1; - } - } - } + } else if (ports) { + if (!strcmp(ports->value, "auto")) { + mainport = CFG_AUTO_PORT; + } else { + int ok; + mainport = (int)tor_parse_long(ports->value, 10, 0, 65535, &ok, NULL); + if (!ok) { + log_warn(LD_CONFIG, "%sListenAddress can only be used with a single " + "%sPort with value \"auto\" or 1-65535.", + portname, portname); + return -1; + } + } + } - if (mainport == 0) { - if (allow_spurious_listenaddr) - return 1; - log_warn(LD_CONFIG, "%sPort must be defined if %sListenAddress is used", - portname, portname); - return -1; - } + if (mainport == 0) { + if (allow_spurious_listenaddr) + return 1; + log_warn(LD_CONFIG, "%sPort must be defined if %sListenAddress is used", + portname, portname); + return -1; + } - for (; listenaddrs; listenaddrs = listenaddrs->next) { - tor_addr_t addr; - uint16_t port = 0; - if (tor_addr_port_parse(listenaddrs->value, &addr, &port) < 0) { - log_warn(LD_CONFIG, "Unable to parse %sListenAddress '%s'", - portname, listenaddrs->value); - return -1; - } - if (out) { - port_cfg_t *cfg = tor_malloc_zero(sizeof(port_cfg_t)); - cfg->type = listener_type; - cfg->port = port ? port : mainport; - tor_addr_copy(&cfg->addr, &addr); - cfg->session_group = SESSION_GROUP_UNSET; - cfg->isolation_flags = ISO_DEFAULT; - smartlist_add(out, cfg); - } - } + for (; listenaddrs; listenaddrs = listenaddrs->next) { + tor_addr_t addr; + uint16_t port = 0; + if (tor_addr_port_parse(listenaddrs->value, &addr, &port) < 0) { + log_warn(LD_CONFIG, "Unable to parse %sListenAddress '%s'", + portname, listenaddrs->value); + return -1; + } + if (out) { + port_cfg_t *cfg = tor_malloc_zero(sizeof(port_cfg_t)); + cfg->type = listener_type; + cfg->port = port ? port : mainport; + tor_addr_copy(&cfg->addr, &addr); + cfg->session_group = SESSION_GROUP_UNSET; + cfg->isolation_flags = ISO_DEFAULT; + smartlist_add(out, cfg); + } + } - if (warn_nonlocal && out) - warn_nonlocal_client_ports(out, portname); - return 0; + if (warn_nonlocal && out) + warn_nonlocal_client_ports(out, portname); + return 0; } /* end if (listenaddrs) */ /* No ListenAddress lines. If there's no FooPort, then maybe make a default |