Kaynağa Gözat

Avoid spurious log messages in setEstablishTunnels.

Rod Hynes 9 yıl önce
ebeveyn
işleme
f9a3d1bb02
1 değiştirilmiş dosya ile 8 ekleme ve 0 silme
  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) {
 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)
 	establishFlag := int32(1)
 	if !establish {
 	if !establish {
 		establishFlag = 0
 		establishFlag = 0