Browse Source

make the default default options.FirewallPorts be the default

svn:r2683
Roger Dingledine 21 years ago
parent
commit
2ba3a9de16
6 changed files with 8 additions and 22 deletions
  1. 1 2
      src/or/circuitbuild.c
  2. 1 12
      src/or/config.c
  3. 1 2
      src/or/directory.c
  4. 3 1
      src/or/hibernate.c
  5. 0 1
      src/or/or.h
  6. 2 4
      src/or/routerlist.c

+ 1 - 2
src/or/circuitbuild.c

@@ -1144,8 +1144,7 @@ static routerinfo_t *choose_good_entry_server(cpath_build_state_t *state)
     for(i=0; i < smartlist_len(rl->routers); i++) {
       r = smartlist_get(rl->routers, i);
       tor_snprintf(buf, sizeof(buf), "%d", r->or_port);
-      if (!smartlist_string_isin(options.FirewallPorts ?
-          options.FirewallPorts : config_get_default_firewallports(), buf))
+      if (!smartlist_string_isin(options.FirewallPorts, buf))
          smartlist_add(excluded, r);
     }
   }

+ 1 - 12
src/or/config.c

@@ -105,7 +105,7 @@ static config_var_t config_vars[] = {
   VAR("ExitPolicy",          LINELIST, ExitPolicy,           NULL),
   VAR("ExcludeNodes",        STRING,   ExcludeNodes,         NULL),
   VAR("FascistFirewall",     BOOL,     FascistFirewall,      "0"),
-  VAR("FirewallPorts",       CSV,      FirewallPorts,        NULL),
+  VAR("FirewallPorts",       CSV,      FirewallPorts,        "80,443"),
   VAR("MyFamily",            STRING,   MyFamily,             NULL),
   VAR("NodeFamily",          LINELIST, NodeFamilies,         NULL),
   VAR("Group",               STRING,   Group,                NULL),
@@ -831,17 +831,6 @@ static int check_nickname_list(const char *lst, const char *name)
   return r;
 }
 
-smartlist_t *config_get_default_firewallports(void) {
-  static smartlist_t *answer;
-
-  if(!answer) {
-    answer = smartlist_create();
-    smartlist_add(answer, tor_strdup("80"));
-    smartlist_add(answer, tor_strdup("443"));
-  }
-  return answer;
-}
-
 static int
 validate_options(or_options_t *options)
 {

+ 1 - 2
src/or/directory.c

@@ -132,8 +132,7 @@ directory_post_to_dirservers(uint8_t purpose, const char *payload,
       if (options.FascistFirewall && purpose == DIR_PURPOSE_UPLOAD_DIR &&
           !options.HttpProxy) {
         tor_snprintf(buf,sizeof(buf),"%d",ds->dir_port);
-        if (!smartlist_string_isin(options.FirewallPorts ?
-            options.FirewallPorts : config_get_default_firewallports(), buf))
+        if (!smartlist_string_isin(options.FirewallPorts, buf))
           continue;
       }
       directory_initiate_command_trusted_dir(ds, purpose, payload, payload_len);

+ 3 - 1
src/or/hibernate.c

@@ -5,7 +5,9 @@
 /**
  * \file hibernate.c
  * \brief Functions to close listeners, stop allowing new circuits,
- * etc in preparation for closing down or going dormant.
+ * etc in preparation for closing down or going dormant; and to track
+ * bandwidth and time intervals to know when to hibernate and when to
+ * stop hibernating.
  **/
 
 /*

+ 0 - 1
src/or/or.h

@@ -1088,7 +1088,6 @@ struct config_line_t {
 
 int config_assign_default_dirservers(void);
 int resolve_my_address(const char *address, uint32_t *addr);
-smartlist_t *config_get_default_firewallports(void);
 int getconfig(int argc, char **argv, or_options_t *options);
 int config_init_logs(or_options_t *options);
 void config_parse_exit_policy(struct config_line_t *cfg,

+ 2 - 4
src/or/routerlist.c

@@ -178,8 +178,7 @@ router_pick_directory_server_impl(int requireothers, int fascistfirewall)
       continue;
     if(fascistfirewall) {
       tor_snprintf(buf,sizeof(buf),"%d",router->dir_port);
-      if (!smartlist_string_isin(options.FirewallPorts ?
-          options.FirewallPorts : config_get_default_firewallports(), buf))
+      if (!smartlist_string_isin(options.FirewallPorts, buf))
         continue;
     }
     smartlist_add(sl, router);
@@ -214,8 +213,7 @@ router_pick_trusteddirserver_impl(int requireother, int fascistfirewall)
         continue;
       if (fascistfirewall) {
         tor_snprintf(buf,sizeof(buf),"%d",d->dir_port);
-        if (!smartlist_string_isin(options.FirewallPorts ?
-            options.FirewallPorts : config_get_default_firewallports(), buf))
+        if (!smartlist_string_isin(options.FirewallPorts, buf))
           continue;
       }
       smartlist_add(sl, d);