make the NoPublish option obsolete.

svn:r6052
This commit is contained in:
Roger Dingledine
2006-02-20 01:21:48 +00:00
parent 0408adb728
commit 498c13b4df
2 changed files with 13 additions and 7 deletions
+9 -3
View File
@@ -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) ||
+4 -4
View File
@@ -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;