Просмотр исходного кода

Support setting NetworkLatencyMultiplier in config

Rod Hynes 7 лет назад
Родитель
Сommit
ea57fe2b56
1 измененных файлов с 10 добавлено и 0 удалено
  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 != "" {