Ver código fonte

Fix: always attempt upgrade download when handshake reports new version

Rod Hynes 10 anos atrás
pai
commit
319cdf19ab
1 arquivos alterados com 4 adições e 2 exclusões
  1. 4 2
      psiphon/controller.go

+ 4 - 2
psiphon/controller.go

@@ -405,8 +405,10 @@ downloadLoop:
 			break downloadLoop
 		}
 
-		// Skip download entirely when a recent download was successful
-		if time.Now().Before(lastDownloadTime.Add(DOWNLOAD_UPGRADE_STALE_PERIOD)) {
+		// Unless handshake is explicitly advertizing a new version, skip
+		// checking entirely when a recent download was successful.
+		if handshakeVersion == "" &&
+			time.Now().Before(lastDownloadTime.Add(DOWNLOAD_UPGRADE_STALE_PERIOD)) {
 			continue
 		}