[or-cvs] make the NoPublish option obsolete.
arma at seul.org
arma at seul.org
Mon Feb 20 01:21:50 UTC 2006
Update of /home2/or/cvsroot/tor/src/or
In directory moria:/home/arma/work/onion/cvs/tor/src/or
Modified Files:
config.c router.c
Log Message:
make the NoPublish option obsolete.
Index: config.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/config.c,v
retrieving revision 1.520
retrieving revision 1.521
diff -u -p -d -r1.520 -r1.521
--- config.c 20 Feb 2006 01:06:27 -0000 1.520
+++ config.c 20 Feb 2006 01:21:48 -0000 1.521
@@ -1545,7 +1545,8 @@ resolve_my_address(or_options_t *options
}
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_optio
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
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) ||
Index: router.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/router.c,v
retrieving revision 1.248
retrieving revision 1.249
diff -u -p -d -r1.248 -r1.249
--- router.c 20 Feb 2006 01:15:38 -0000 1.248
+++ router.c 20 Feb 2006 01:21:48 -0000 1.249
@@ -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;
More information about the tor-commits
mailing list