瀏覽代碼

Report when client is already latest version
* New upgrade monitor can use this notice to stop temporary
tunnel core instances used solely for upgrade checks.

Rod Hynes 10 年之前
父節點
當前提交
fd2426b104
共有 3 個文件被更改,包括 10 次插入3 次删除
  1. 7 0
      psiphon/notice.go
  2. 2 0
      psiphon/serverApi.go
  3. 1 3
      psiphon/upgradeDownload.go

+ 7 - 0
psiphon/notice.go

@@ -188,6 +188,13 @@ func NoticeClientUpgradeAvailable(version string) {
 	outputNotice("ClientUpgradeAvailable", false, false, "version", version)
 }
 
+// NoticeClientIsLatestVersion reports that an upgrade check was made and the client
+// is already the latest version. availableVersion is the version available for download,
+// if known.
+func NoticeClientIsLatestVersion(availableVersion string) {
+	outputNotice("ClientIsLatestVersion", false, false, "availableVersion", availableVersion)
+}
+
 // NoticeClientUpgradeAvailable is a sponsor homepage, as per the handshake. The client
 // should display the sponsor's homepage.
 func NoticeHomepage(url string) {

+ 2 - 0
psiphon/serverApi.go

@@ -199,6 +199,8 @@ func (serverContext *ServerContext) doHandshakeRequest() error {
 	serverContext.clientUpgradeVersion = handshakeConfig.UpgradeClientVersion
 	if handshakeConfig.UpgradeClientVersion != "" {
 		NoticeClientUpgradeAvailable(handshakeConfig.UpgradeClientVersion)
+	} else {
+		NoticeClientIsLatestVersion("")
 	}
 
 	var regexpsNotices []string

+ 1 - 3
psiphon/upgradeDownload.go

@@ -128,9 +128,7 @@ func DownloadUpgrade(
 		}
 
 		if currentClientVersion >= checkAvailableClientVersion {
-			NoticeInfo(
-				"skipping download of available client version %d",
-				checkAvailableClientVersion)
+			NoticeClientIsLatestVersion(availableClientVersion)
 			return nil
 		}
 	}