aboutsummaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorYawning Angel <yawning@schwanenlied.me>2015-09-01 16:30:48 +0000
committerNick Mathewson <nickm@torproject.org>2015-09-08 14:02:08 -0400
commit54510d4d1a66d2dd9a618699bd2e51bf4ade4dea (patch)
tree65cc4e1666368fffa57b4b1d0e8df14b0b81611c /src/or/config.c
parenta16115d9cb8c2e88da8a59c212155e2fd0e16aa3 (diff)
downloadtor-54510d4d1a66d2dd9a618699bd2e51bf4ade4dea.tar.gz
tor-54510d4d1a66d2dd9a618699bd2e51bf4ade4dea.zip
Add `KeepAliveIsolateSOCKSAuth` as a SOCKSPort option.
This controls the circuit dirtyness reset behavior added for Tor Browser's user experience fix (#15482). Unlike previous iterations of this patch, the tunable actually works, and is documented.
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 6e782de0e0..aca956cf34 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -6022,6 +6022,7 @@ parse_port_config(smartlist_t *out,
int sessiongroup = SESSION_GROUP_UNSET;
unsigned isolation = ISO_DEFAULT;
int prefer_no_auth = 0;
+ int socks_iso_keep_alive = 0;
char *addrport;
uint16_t ptmp=0;
@@ -6246,6 +6247,8 @@ parse_port_config(smartlist_t *out,
isoflag = ISO_CLIENTPROTO;
} else if (!strcasecmp(elt, "IsolateClientAddr")) {
isoflag = ISO_CLIENTADDR;
+ } else if (!strcasecmp(elt, "KeepAliveIsolateSOCKSAuth")) {
+ socks_iso_keep_alive = 1;
} else {
log_warn(LD_CONFIG, "Unrecognized %sPort option '%s'",
portname, escaped(elt_orig));
@@ -6276,6 +6279,13 @@ parse_port_config(smartlist_t *out,
goto err;
}
+ if (!(isolation & ISO_SOCKSAUTH) && socks_iso_keep_alive) {
+ log_warn(LD_CONFIG, "You have a %sPort entry with both "
+ "NoIsolateSOCKSAuth and KeepAliveIsolateSOCKSAuth set.",
+ portname);
+ goto err;
+ }
+
if (out && port) {
size_t namelen = unix_socket_path ? strlen(unix_socket_path) : 0;
port_cfg_t *cfg = port_cfg_new(namelen);
@@ -6309,6 +6319,7 @@ parse_port_config(smartlist_t *out,
cfg->entry_cfg.socks_prefer_no_auth = prefer_no_auth;
if (! (isolation & ISO_SOCKSAUTH))
cfg->entry_cfg.socks_prefer_no_auth = 1;
+ cfg->entry_cfg.socks_iso_keep_alive = socks_iso_keep_alive;
smartlist_add(out, cfg);
}