Преглед изворни кода

Avoid spurious log messages in setEstablishTunnels.

Rod Hynes пре 9 година
родитељ
комит
f9a3d1bb02
1 измењених фајлова са 8 додато и 0 уклоњено
  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