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

Fix: GetConfigurationVersion returns correct value

- Invalid type expectation caused GetConfigurationVersion
  to always return 0.

- As a result embedded server entries with greater
  configuration versions did not overwrite existing
  server entries.
Rod Hynes 6 лет назад
Родитель
Сommit
b6d6f21eec
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      psiphon/common/protocol/serverEntry.go

+ 2 - 2
psiphon/common/protocol/serverEntry.go

@@ -134,11 +134,11 @@ func (fields ServerEntryFields) GetConfigurationVersion() int {
 	if !ok {
 		return 0
 	}
-	configurationVersionInt, ok := configurationVersion.(int)
+	configurationVersionFloat, ok := configurationVersion.(float64)
 	if !ok {
 		return 0
 	}
-	return configurationVersionInt
+	return int(configurationVersionFloat)
 }
 
 func (fields ServerEntryFields) GetLocalSource() string {