summaryrefslogtreecommitdiff
path: root/obfs4proxy/pt_extras.go
diff options
context:
space:
mode:
authorYawning Angel <yawning@torproject.org>2015-03-28 03:09:17 +0000
committerYawning Angel <yawning@torproject.org>2015-03-28 03:09:17 +0000
commit402fe97d8547d216746d2237010f32b691cb71e1 (patch)
tree127608f71b1c8428a723b47769d5c91511ee1fdc /obfs4proxy/pt_extras.go
parent657c8e4f02ad6c6c3cc97256b7529fe5514c0945 (diff)
Add support for tor feature #15435.
If the relevant enviornment variable is set, treat read errors from Stdin as a SIGTERM.
Diffstat (limited to 'obfs4proxy/pt_extras.go')
-rw-r--r--obfs4proxy/pt_extras.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/obfs4proxy/pt_extras.go b/obfs4proxy/pt_extras.go
index 9eddd26..f490fbc 100644
--- a/obfs4proxy/pt_extras.go
+++ b/obfs4proxy/pt_extras.go
@@ -158,3 +158,9 @@ func resolveAddrStr(addrStr string) (*net.TCPAddr, error) {
return &net.TCPAddr{IP: ip, Port: int(port), Zone: ""}, nil
}
+
+// Feature #15435 adds a new env var for determining if Tor keeps stdin
+// open for use in termination detection.
+func ptShouldExitOnStdinClose() bool {
+ return os.Getenv("TOR_PT_EXIT_ON_STDIN_CLOSE") == "1"
+}