From 402fe97d8547d216746d2237010f32b691cb71e1 Mon Sep 17 00:00:00 2001 From: Yawning Angel Date: Sat, 28 Mar 2015 03:09:17 +0000 Subject: Add support for tor feature #15435. If the relevant enviornment variable is set, treat read errors from Stdin as a SIGTERM. --- obfs4proxy/pt_extras.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'obfs4proxy/pt_extras.go') 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" +} -- cgit v1.2.3