[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Merge remote branch 'sebastian/bug2496'



commit 2eadbd41f0d0356898c75d7fab032109a85bc9e9
Merge: b7f201f 7736f44
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Tue Feb 22 14:17:11 2011 -0500

    Merge remote branch 'sebastian/bug2496'

 src/or/config.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --combined src/or/config.c
index 97a2b32,1dc042d..aa4d974
--- a/src/or/config.c
+++ b/src/or/config.c
@@@ -197,7 -197,6 +197,7 @@@ static config_var_t _option_vars[] = 
    V(CircuitStreamTimeout,        INTERVAL, "0"),
    V(CircuitPriorityHalflife,     DOUBLE,  "-100.0"), /*negative:'Use default'*/
    V(ClientDNSRejectInternalAddresses, BOOL,"1"),
 +  V(ClientRejectInternalAddresses, BOOL,   "1"),
    V(ClientOnly,                  BOOL,     "0"),
    V(ConsensusParams,             STRING,   NULL),
    V(ConnLimit,                   UINT,     "1000"),
@@@ -267,7 -266,6 +267,7 @@@
  #endif
    OBSOLETE("Group"),
    V(HardwareAccel,               BOOL,     "0"),
 +  V(HeartbeatPeriod,             INTERVAL, "6 hours"),
    V(AccelName,                   STRING,   NULL),
    V(AccelDir,                    FILENAME, NULL),
    V(HashedControlPassword,       LINELIST, NULL),
@@@ -293,7 -291,6 +293,7 @@@
    OBSOLETE("IgnoreVersion"),
    V(KeepalivePeriod,             INTERVAL, "5 minutes"),
    VAR("Log",                     LINELIST, Logs,             NULL),
 +  V(LogMessageDomains,           BOOL,     "0"),
    OBSOLETE("LinkPadding"),
    OBSOLETE("LogLevel"),
    OBSOLETE("LogFile"),
@@@ -416,7 -413,6 +416,7 @@@ static config_var_t testing_tor_network
    V(AuthDirMaxServersPerAddr,    UINT,     "0"),
    V(AuthDirMaxServersPerAuthAddr,UINT,     "0"),
    V(ClientDNSRejectInternalAddresses, BOOL,"0"),
 +  V(ClientRejectInternalAddresses, BOOL,   "0"),
    V(ExitPolicyRejectPrivate,     BOOL,     "0"),
    V(V3AuthVotingInterval,        INTERVAL, "5 minutes"),
    V(V3AuthVoteDelay,             INTERVAL, "20 seconds"),
@@@ -1390,10 -1386,12 +1390,12 @@@ options_act(or_options_t *old_options
          print_notice = 1;
        } else {
          options->DirReqStatistics = 0;
-         log_notice(LD_CONFIG, "Configured to measure directory request "
-                               "statistics, but no GeoIP database found! "
-                               "Please specify a GeoIP database using the "
-                               "GeoIPFile option!");
+         /* Don't warn Tor clients, they don't use statistics */
+         if (options->ORPort)
+           log_notice(LD_CONFIG, "Configured to measure directory request "
+                                 "statistics, but no GeoIP database found. "
+                                 "Please specify a GeoIP database using the "
+                                 "GeoIPFile option.");
        }
      }
      if ((!old_options || !old_options->EntryStatistics) &&
@@@ -1404,9 -1402,9 +1406,9 @@@
        } else {
          options->EntryStatistics = 0;
          log_notice(LD_CONFIG, "Configured to measure entry node "
-                               "statistics, but no GeoIP database found! "
+                               "statistics, but no GeoIP database found. "
                                "Please specify a GeoIP database using the "
-                               "GeoIPFile option!");
+                               "GeoIPFile option.");
        }
      }
      if ((!old_options || !old_options->ExitPortStatistics) &&
@@@ -2891,9 -2889,7 +2893,9 @@@ compute_publishserverdescriptor(or_opti
      else if (!strcasecmp(string, "bridge"))
        *auth |= BRIDGE_AUTHORITY;
      else if (!strcasecmp(string, "hidserv"))
 -      *auth |= HIDSERV_AUTHORITY;
 +      log_warn(LD_CONFIG,
 +               "PublishServerDescriptor hidserv is invalid. See "
 +               "PublishHidServDescriptors.");
      else if (!strcasecmp(string, "") || !strcmp(string, "0"))
        /* no authority */;
      else
@@@ -2917,10 -2913,6 +2919,10 @@@
   * will generate too many circuits and potentially overload the network. */
  #define MIN_CIRCUIT_STREAM_TIMEOUT 10
  
 +/** Lowest allowable value for HeartbeatPeriod; if this is too low, we might
 + * expose more information than we're comfortable with. */
 +#define MIN_HEARTBEAT_PERIOD (30*60)
 +
  /** Return 0 if every setting in <b>options</b> is reasonable, and a
   * permissible transition from <b>old_options</b>. Else return -1.
   * Should have no side effects, except for normalizing the contents of
@@@ -3383,13 -3375,6 +3385,13 @@@ options_validate(or_options_t *old_opti
      options->CircuitStreamTimeout = MIN_CIRCUIT_STREAM_TIMEOUT;
    }
  
 +  if (options->HeartbeatPeriod &&
 +      options->HeartbeatPeriod < MIN_HEARTBEAT_PERIOD) {
 +    log_warn(LD_CONFIG, "HeartbeatPeriod option is too short; "
 +             "raising to %d seconds.", MIN_HEARTBEAT_PERIOD);
 +    options->HeartbeatPeriod = MIN_HEARTBEAT_PERIOD;
 +  }
 +
    if (options->KeepalivePeriod < 1)
      REJECT("KeepalivePeriod option must be positive.");
  
@@@ -3415,11 -3400,6 +3417,11 @@@
                             "PerConnBWBurst", msg) < 0)
      return -1;
  
 +  if (options->RelayBandwidthRate && !options->RelayBandwidthBurst)
 +    options->RelayBandwidthBurst = options->RelayBandwidthRate;
 +  if (options->RelayBandwidthBurst && !options->RelayBandwidthRate)
 +    options->RelayBandwidthRate = options->RelayBandwidthBurst;
 +
    if (server_mode(options)) {
      if (options->BandwidthRate < ROUTER_REQUIRED_MIN_BANDWIDTH) {
        tor_asprintf(msg,
@@@ -3448,6 -3428,9 +3450,6 @@@
      }
    }
  
 -  if (options->RelayBandwidthRate && !options->RelayBandwidthBurst)
 -    options->RelayBandwidthBurst = options->RelayBandwidthRate;
 -
    if (options->RelayBandwidthRate > options->RelayBandwidthBurst)
      REJECT("RelayBandwidthBurst must be at least equal "
             "to RelayBandwidthRate.");
@@@ -3889,8 -3872,7 +3891,8 @@@ options_transition_affects_workers(or_o
        old_options->SafeLogging != new_options->SafeLogging ||
        old_options->ClientOnly != new_options->ClientOnly ||
        public_server_mode(old_options) != public_server_mode(new_options) ||
 -      !config_lines_eq(old_options->Logs, new_options->Logs))
 +      !config_lines_eq(old_options->Logs, new_options->Logs) ||
 +      old_options->LogMessageDomains != new_options->LogMessageDomains)
      return 1;
  
    /* Check whether log options match. */
@@@ -4107,8 -4089,6 +4109,8 @@@ load_torrc_from_disk(int argc, char **a
            "Unable to open configuration file \"%s\".", fname);
        goto err;
      }
 +  } else {
 +    log(LOG_NOTICE, LD_CONFIG, "Read configuration file \"%s\".", fname);
    }
  
    return cf;
@@@ -4497,9 -4477,6 +4499,9 @@@ options_init_logs(or_options_t *options
    }
    smartlist_free(elts);
  
 +  if (ok && !validate_only)
 +    logs_set_domain_logging(options->LogMessageDomains);
 +
    return ok?0:-1;
  }
  

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits