Quellcode durchsuchen

Refactor: Simplify logic to always remove TLS cache entry on a failed dial

Amir Khan vor 1 Jahr
Ursprung
Commit
8e4daafb01
1 geänderte Dateien mit 4 neuen und 12 gelöschten Zeilen
  1. 4 12
      psiphon/dialParameters.go

+ 4 - 12
psiphon/dialParameters.go

@@ -1514,20 +1514,12 @@ func (dialParams *DialParameters) Failed(config *Config) {
 	// Clear the TLS client session cache to avoid (potentially) reusing failed sessions for
 	// Clear the TLS client session cache to avoid (potentially) reusing failed sessions for
 	// Meek, TLS-OSSH and QUIC connections.
 	// Meek, TLS-OSSH and QUIC connections.
 
 
-	if protocol.TunnelProtocolUsesQUIC(dialParams.TunnelProtocol) {
-		if dialParams.quicTLSClientSessionCache != nil {
-			dialParams.quicTLSClientSessionCache.RemoveCacheEntry()
-		}
+	if dialParams.quicTLSClientSessionCache != nil {
+		dialParams.quicTLSClientSessionCache.RemoveCacheEntry()
 	}
 	}
 
 
-	usingTLS := protocol.TunnelProtocolUsesMeekHTTPS(dialParams.TunnelProtocol) ||
-		protocol.TunnelProtocolUsesTLSOSSH(dialParams.TunnelProtocol) ||
-		dialParams.ConjureAPIRegistration
-
-	if usingTLS {
-		if dialParams.tlsClientSessionCache != nil {
-			dialParams.tlsClientSessionCache.RemoveCacheEntry()
-		}
+	if dialParams.tlsClientSessionCache != nil {
+		dialParams.tlsClientSessionCache.RemoveCacheEntry()
 	}
 	}
 
 
 }
 }