commit 9ca6344b85d7880c171d167a1fc5974239dccac1 Author: David Fifield david@bamsoftware.com Date: Thu May 8 01:20:34 2014 -0700
Set TOR_PT_SERVER_TRANSPORT_OPTIONS only if non-empty.
obfsproxy doesn't handle an empty value for this variable: ENV-ERROR error parsing env-var: TOR_PT_SERVER_TRANSPORT_OPTIONS: Invalid options string () --- obfs-flash-server.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/obfs-flash-server.go b/obfs-flash-server.go index 047fd0d..b56270d 100644 --- a/obfs-flash-server.go +++ b/obfs-flash-server.go @@ -203,9 +203,12 @@ func startProcesses(connectBackAddr net.Addr, plugins []ServerTransportPlugin) ( "TOR_PT_EXTENDED_SERVER_PORT=", "TOR_PT_ORPORT=" + bindAddr.String(), "TOR_PT_SERVER_TRANSPORTS=" + plugin.MethodName, - "TOR_PT_SERVER_TRANSPORT_OPTIONS=" + encodeServerTransportOptions(plugin.MethodName, plugin.Options), "TOR_PT_SERVER_BINDADDR=" + plugin.MethodName + "-127.0.0.1:0", } + serverTransportOptions := encodeServerTransportOptions(plugin.MethodName, plugin.Options) + if serverTransportOptions != "" { + cmd.Env = append(cmd.Env, "TOR_PT_SERVER_TRANSPORT_OPTIONS=" + serverTransportOptions) + } log("%s environment %q", cmd.Args[0], cmd.Env) stdout, err = cmd.StdoutPipe() if err != nil {