Parcourir la source

Support setting NetworkLatencyMultiplier in config

Rod Hynes il y a 7 ans
Parent
commit
ea57fe2b56
1 fichiers modifiés avec 10 ajouts et 0 suppressions
  1. 10 0
      psiphon/config.go

+ 10 - 0
psiphon/config.go

@@ -117,6 +117,12 @@ type Config struct {
 	// DisableLocalHTTPProxy disables running the local HTTP proxy.
 	DisableLocalHTTPProxy bool
 
+	// NetworkLatencyMultiplier is a multiplier that is to be applied to
+	// default network event timeouts. Set this to tune performence for
+	// slow networks.
+	// When set, must be >= 1.0.
+	NetworkLatencyMultiplier float64
+
 	// TunnelProtocol indicates which protocol to use. For the default, "",
 	// all protocols are used.
 	//
@@ -667,6 +673,10 @@ func (config *Config) makeConfigParameters() map[string]interface{} {
 
 	applyParameters := make(map[string]interface{})
 
+	if config.NetworkLatencyMultiplier > 0.0 {
+		applyParameters[parameters.NetworkLatencyMultiplier] = config.NetworkLatencyMultiplier
+	}
+
 	if len(config.TunnelProtocols) > 0 {
 		applyParameters[parameters.LimitTunnelProtocols] = protocol.TunnelProtocols(config.TunnelProtocols)
 	} else if config.TunnelProtocol != "" {