Prechádzať zdrojové kódy

Merge remote-tracking branch 'upstream/master'

Eugene Fryntov 9 rokov pred
rodič
commit
c511dd3136
1 zmenil súbory, kde vykonal 16 pridanie a 10 odobranie
  1. 16 10
      psiphon/controller.go

+ 16 - 10
psiphon/controller.go

@@ -586,17 +586,23 @@ loop:
 
 				NoticeAlert("established tunnel with impaired protocol: %s", establishedTunnel.protocol)
 
-				// Protocol was classified as impaired while this tunnel
-				// established, so discard.
-				controller.discardTunnel(establishedTunnel)
-
-				// Reset establish generator to stop producing tunnels
-				// with impaired protocols.
-				if controller.isEstablishing {
-					controller.stopEstablishing()
-					controller.startEstablishing()
+				// Take action only when TunnelProtocol is unset, as it limits the
+				// controller to a single protocol. For testing and diagnostics, we
+				// still allow classification when TunnelProtocol is set.
+				if controller.config.TunnelProtocol == "" {
+
+					// Protocol was classified as impaired while this tunnel
+					// established, so discard.
+					controller.discardTunnel(establishedTunnel)
+
+					// Reset establish generator to stop producing tunnels
+					// with impaired protocols.
+					if controller.isEstablishing {
+						controller.stopEstablishing()
+						controller.startEstablishing()
+					}
+					break
 				}
-				break
 			}
 
 			tunnelCount, registered := controller.registerTunnel(establishedTunnel)