aboutsummaryrefslogtreecommitdiff
path: root/src/or/transports.c
diff options
context:
space:
mode:
authorYawning Angel <yawning@schwanenlied.me>2015-03-26 12:55:12 +0000
committerYawning Angel <yawning@schwanenlied.me>2015-03-26 12:55:12 +0000
commitfda61e030e12cbd66a2be9905e6855ec6c6a3c63 (patch)
treeb0b7f8188707e73e788b33181c796c73106998d3 /src/or/transports.c
parent732322b710d515a55ebbaa984fa12f19ccb333e8 (diff)
downloadtor-fda61e030e12cbd66a2be9905e6855ec6c6a3c63.tar.gz
tor-fda61e030e12cbd66a2be9905e6855ec6c6a3c63.zip
Implement "TOR_PT_EXIT_ON_STDIN_CLOSE".
Background processes spawned by Tor now will have a valid stdin. Pluggable transports can detect this behavior with the aformentioned enviornment variable, and exit if stdin ever gets closed.
Diffstat (limited to 'src/or/transports.c')
-rw-r--r--src/or/transports.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/or/transports.c b/src/or/transports.c
index 6f07054ea8..ba2c784c2c 100644
--- a/src/or/transports.c
+++ b/src/or/transports.c
@@ -1388,6 +1388,11 @@ create_managed_proxy_environment(const managed_proxy_t *mp)
} else {
smartlist_add_asprintf(envs, "TOR_PT_EXTENDED_SERVER_PORT=");
}
+
+ /* All new versions of tor will keep stdin open, so PTs can use it
+ * as a reliable termination detection mechanism.
+ */
+ smartlist_add_asprintf(envs, "TOR_PT_EXIT_ON_STDIN_CLOSE=1");
} else {
/* If ClientTransportPlugin has a HTTPS/SOCKS proxy configured, set the
* TOR_PT_PROXY line.