Prechádzať zdrojové kódy

Skip PromoteServerEntry in TargetServerEntry mode

Rod Hynes 10 rokov pred
rodič
commit
fb87e7981d
1 zmenil súbory, kde vykonal 5 pridanie a 1 odobranie
  1. 5 1
      psiphon/controller.go

+ 5 - 1
psiphon/controller.go

@@ -626,7 +626,11 @@ func (controller *Controller) registerTunnel(tunnel *Tunnel) (int, bool) {
 
 	// Promote this successful tunnel to first rank so it's one
 	// of the first candidates next time establish runs.
-	PromoteServerEntry(tunnel.serverEntry.IpAddress)
+	// Connecting to a TargetServerEntry does not change the
+	// ranking.
+	if controller.config.TargetServerEntry == "" {
+		PromoteServerEntry(tunnel.serverEntry.IpAddress)
+	}
 
 	return len(controller.tunnels), true
 }