summaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-01-03 12:44:10 -0500
committerNick Mathewson <nickm@torproject.org>2015-01-16 09:22:49 -0500
commitf444f2b1d3e045d30cc15e6c1e4d890c40c82b3d (patch)
treef2ca040147db83d3893b94ffe5fa481175df5f7f /src/or/connection.c
parentfc0febc5c62a8c5ad2373b43641a70a8d793a469 (diff)
downloadtor-f444f2b1d3e045d30cc15e6c1e4d890c40c82b3d.tar.gz
tor-f444f2b1d3e045d30cc15e6c1e4d890c40c82b3d.zip
Split client-specific and server-specific parts of port_cfg_t
Also, apply this cocci script to transform accesses. (Plus manual migration for accesses inside smartlist_foreach loops.) @@ port_cfg_t *cfgx; @@ cfgx-> +server_cfg. \( no_advertise \| no_listen \| all_addrs \| bind_ipv4_only \| bind_ipv6_only \) @@ port_cfg_t *cfgx; @@ cfgx-> +entry_cfg. \( isolation_flags \| session_group \| socks_prefer_no_auth \| ipv4_traffic \| ipv6_traffic \| prefer_ipv6 \| cache_ipv4_answers \| cache_ipv6_answers \| use_cached_ipv4_answers \| use_cached_ipv6_answers \| prefer_ipv6_virtaddr \)
Diffstat (limited to 'src/or/connection.c')
-rw-r--r--src/or/connection.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index c77d29b536..84df6e7561 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -1198,10 +1198,10 @@ connection_listener_new(const struct sockaddr *listensockaddr,
conn->port = gotPort;
tor_addr_copy(&conn->addr, &addr);
- if (port_cfg->isolation_flags) {
- lis_conn->isolation_flags = port_cfg->isolation_flags;
- if (port_cfg->session_group >= 0) {
- lis_conn->session_group = port_cfg->session_group;
+ if (port_cfg->entry_cfg.isolation_flags) {
+ lis_conn->isolation_flags = port_cfg->entry_cfg.isolation_flags;
+ if (port_cfg->entry_cfg.session_group >= 0) {
+ lis_conn->session_group = port_cfg->entry_cfg.session_group;
} else {
/* This can wrap after around INT_MAX listeners are opened. But I don't
* believe that matters, since you would need to open a ridiculous
@@ -1213,19 +1213,19 @@ connection_listener_new(const struct sockaddr *listensockaddr,
}
}
if (type == CONN_TYPE_AP_LISTENER) {
- lis_conn->socks_ipv4_traffic = port_cfg->ipv4_traffic;
- lis_conn->socks_ipv6_traffic = port_cfg->ipv6_traffic;
- lis_conn->socks_prefer_ipv6 = port_cfg->prefer_ipv6;
+ lis_conn->socks_ipv4_traffic = port_cfg->entry_cfg.ipv4_traffic;
+ lis_conn->socks_ipv6_traffic = port_cfg->entry_cfg.ipv6_traffic;
+ lis_conn->socks_prefer_ipv6 = port_cfg->entry_cfg.prefer_ipv6;
} else {
lis_conn->socks_ipv4_traffic = 1;
lis_conn->socks_ipv6_traffic = 1;
}
- lis_conn->cache_ipv4_answers = port_cfg->cache_ipv4_answers;
- lis_conn->cache_ipv6_answers = port_cfg->cache_ipv6_answers;
- lis_conn->use_cached_ipv4_answers = port_cfg->use_cached_ipv4_answers;
- lis_conn->use_cached_ipv6_answers = port_cfg->use_cached_ipv6_answers;
- lis_conn->prefer_ipv6_virtaddr = port_cfg->prefer_ipv6_virtaddr;
- lis_conn->socks_prefer_no_auth = port_cfg->socks_prefer_no_auth;
+ lis_conn->cache_ipv4_answers = port_cfg->entry_cfg.cache_ipv4_answers;
+ lis_conn->cache_ipv6_answers = port_cfg->entry_cfg.cache_ipv6_answers;
+ lis_conn->use_cached_ipv4_answers = port_cfg->entry_cfg.use_cached_ipv4_answers;
+ lis_conn->use_cached_ipv6_answers = port_cfg->entry_cfg.use_cached_ipv6_answers;
+ lis_conn->prefer_ipv6_virtaddr = port_cfg->entry_cfg.prefer_ipv6_virtaddr;
+ lis_conn->socks_prefer_no_auth = port_cfg->entry_cfg.socks_prefer_no_auth;
if (connection_add(conn) < 0) { /* no space, forget it */
log_warn(LD_NET,"connection_add for listener failed. Giving up.");
@@ -2184,7 +2184,7 @@ retry_listener_ports(smartlist_t *old_conns,
(conn->socket_family == AF_UNIX && ! wanted->is_unix_addr))
continue;
- if (wanted->no_listen)
+ if (wanted->server_cfg.no_listen)
continue; /* We don't want to open a listener for this one */
if (wanted->is_unix_addr) {
@@ -2225,7 +2225,7 @@ retry_listener_ports(smartlist_t *old_conns,
connection_t *conn;
int real_port = port->port == CFG_AUTO_PORT ? 0 : port->port;
tor_assert(real_port <= UINT16_MAX);
- if (port->no_listen)
+ if (port->server_cfg.no_listen)
continue;
if (port->is_unix_addr) {