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

Add some replay parameters to config file for testing

Rod Hynes 7 лет назад
Родитель
Сommit
e5bdf5caad
1 измененных файлов с 13 добавлено и 0 удалено
  1. 13 0
      psiphon/config.go

+ 13 - 0
psiphon/config.go

@@ -501,6 +501,11 @@ type Config struct {
 	LivenessTestMinDownstreamBytes *int
 	LivenessTestMaxDownstreamBytes *int
 
+	// ReplayCandidateCount and other Replay fields are for
+	// testing purposes.
+	ReplayCandidateCount           *int
+	ReplayDialParametersTTLSeconds *int
+
 	// clientParameters is the active ClientParameters with defaults, config
 	// values, and, optionally, tactics applied.
 	//
@@ -976,6 +981,14 @@ func (config *Config) makeConfigParameters() map[string]interface{} {
 		applyParameters[parameters.LivenessTestMaxDownstreamBytes] = *config.LivenessTestMaxDownstreamBytes
 	}
 
+	if config.ReplayCandidateCount != nil {
+		applyParameters[parameters.ReplayCandidateCount] = *config.ReplayCandidateCount
+	}
+
+	if config.ReplayDialParametersTTLSeconds != nil {
+		applyParameters[parameters.ReplayDialParametersTTL] = fmt.Sprintf("%ds", *config.ReplayDialParametersTTLSeconds)
+	}
+
 	return applyParameters
 }