Przeglądaj źródła

Merge pull request #273 from rod-hynes/master

Avoid spurious log messages in setEstablishTunnels
Rod Hynes 9 lat temu
rodzic
commit
38039653e3
1 zmienionych plików z 8 dodań i 0 usunięć
  1. 8 0
      psiphon/server/tunnelServer.go

+ 8 - 0
psiphon/server/tunnelServer.go

@@ -259,6 +259,14 @@ func newSSHServer(
 }
 
 func (sshServer *sshServer) setEstablishTunnels(establish bool) {
+
+	// Do nothing when the setting is already correct. This avoids
+	// spurious log messages when setEstablishTunnels is called
+	// periodically with the same setting.
+	if establish == sshServer.getEstablishTunnels() {
+		return
+	}
+
 	establishFlag := int32(1)
 	if !establish {
 		establishFlag = 0