summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-02-20 01:21:48 +0000
committerRoger Dingledine <arma@torproject.org>2006-02-20 01:21:48 +0000
commit498c13b4df142d7dc48eb373166f8c01cf09f56d (patch)
tree9e1eb4d0b314f76f1aa555e840cadfbde4c406cb
parent0408adb7287db0d8738beb14af8f061c2b660d37 (diff)
downloadtor-498c13b4df142d7dc48eb373166f8c01cf09f56d.tar.gz
tor-498c13b4df142d7dc48eb373166f8c01cf09f56d.zip
make the NoPublish option obsolete.
svn:r6052
-rw-r--r--src/or/config.c12
-rw-r--r--src/or/router.c8
2 files changed, 13 insertions, 7 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 21fb3216c7..08a17814a1 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -1545,7 +1545,8 @@ resolve_my_address(or_options_t *options, uint32_t *addr_out,
}
tor_inet_ntoa(&in,tmpbuf,sizeof(tmpbuf));
- if (is_internal_IP(htonl(in.s_addr), 0) && !options->NoPublish) {
+ if (is_internal_IP(htonl(in.s_addr), 0) &&
+ options->PublishServerDescriptor) {
/* make sure we're ok with publishing an internal IP */
if (!options->DirServers) {
/* if they are using the default dirservers, disallow internal IPs
@@ -2099,8 +2100,11 @@ options_validate(or_options_t *old_options, or_options_t *options,
if (options->AuthoritativeDir && options->ClientOnly)
REJECT("Running as authoritative directory, but ClientOnly also set.");
- if (options->AuthoritativeDir && options->NoPublish)
- REJECT("You cannot set both AuthoritativeDir and NoPublish.");
+ if (options->NoPublish) {
+ log(LOG_WARN, LD_CONFIG,
+ "NoPublish is obsolete. Use PublishServerDescriptor instead.");
+ options->PublishServerDescriptor = 0;
+ }
if (options->ConnLimit <= 0) {
log(LOG_WARN, LD_CONFIG,
@@ -2517,6 +2521,8 @@ options_transition_affects_descriptor(or_options_t *old_options,
old_options->DirPort != new_options->DirPort ||
old_options->ClientOnly != new_options->ClientOnly ||
old_options->NoPublish != new_options->NoPublish ||
+ old_options->PublishServerDescriptor !=
+ new_options->PublishServerDescriptor ||
old_options->BandwidthRate != new_options->BandwidthRate ||
old_options->BandwidthBurst != new_options->BandwidthBurst ||
!opt_streq(old_options->ContactInfo, new_options->ContactInfo) ||
diff --git a/src/or/router.c b/src/or/router.c
index f623b71df5..e15cc73e2c 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -472,8 +472,8 @@ router_orport_found_reachable(void)
if (!clique_mode(get_options()))
log_notice(LD_OR,"Self-testing indicates your ORPort is reachable from "
"the outside. Excellent.%s",
- get_options()->NoPublish ?
- "" : " Publishing server descriptor.");
+ get_options()->PublishServerDescriptor ?
+ " Publishing server descriptor." : "");
can_reach_or_port = 1;
mark_my_descriptor_dirty();
consider_publishable_server(time(NULL), 1);
@@ -557,7 +557,7 @@ proxy_mode(or_options_t *options)
/** Decide if we're a publishable server. We are a publishable server if:
* - We don't have the ClientOnly option set
* and
- * - We don't have the NoPublish option set
+ * - We have the PublishServerDescriptor option set
* and
* - We have ORPort set
* and
@@ -571,7 +571,7 @@ decide_if_publishable_server(time_t now)
if (options->ClientOnly)
return 0;
- if (options->NoPublish)
+ if (!options->PublishServerDescriptor)
return 0;
if (!server_mode(options))
return 0;