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);
}
}
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),
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)
{
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);
/**
* \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.
**/
/*
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,
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);
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);