Remove clientID from unused branch

This commit is contained in:
Shelikhoo 2024-09-12 14:22:15 +01:00 committed by WofWca
parent 1da7fecbed
commit c7b163de57

View file

@ -78,8 +78,6 @@ type Transport struct {
// EventDispatcher is the event bus for snowflake events. // EventDispatcher is the event bus for snowflake events.
// When an important event happens, it will be distributed here. // When an important event happens, it will be distributed here.
eventDispatcher event.SnowflakeEventDispatcher eventDispatcher event.SnowflakeEventDispatcher
clientID turbotunnel.ClientID
} }
// ClientConfig defines how the SnowflakeClient will connect to the broker and Snowflake proxies. // ClientConfig defines how the SnowflakeClient will connect to the broker and Snowflake proxies.
@ -169,7 +167,7 @@ func NewSnowflakeClient(config ClientConfig) (*Transport, error) {
clientID := turbotunnel.NewClientID() clientID := turbotunnel.NewClientID()
transport := &Transport{ transport := &Transport{
dialer: NewWebRTCDialerWithNatPolicyAndEventsAndProxyAndClientID(broker, natPolicy, iceServers, max, eventsLogger, config.CommunicationProxy, clientID), dialer: NewWebRTCDialerWithNatPolicyAndEventsAndProxyAndClientID(broker, natPolicy, iceServers, max, eventsLogger, config.CommunicationProxy, clientID),
eventDispatcher: eventsLogger, clientID: clientID, eventDispatcher: eventsLogger,
} }
return transport, nil return transport, nil
@ -204,7 +202,7 @@ func (t *Transport) Dial() (net.Conn, error) {
// Create a new smux session // Create a new smux session
log.Printf("---- SnowflakeConn: starting a new session ---") log.Printf("---- SnowflakeConn: starting a new session ---")
pconn, sess, err := newSession(snowflakes, t.clientID) pconn, sess, err := newSession(snowflakes)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -330,7 +328,7 @@ func parseIceServers(addresses []string) []webrtc.ICEServer {
// newSession returns a new smux.Session and the net.PacketConn it is running // newSession returns a new smux.Session and the net.PacketConn it is running
// over. The net.PacketConn successively connects through Snowflake proxies // over. The net.PacketConn successively connects through Snowflake proxies
// pulled from snowflakes. // pulled from snowflakes.
func newSession(snowflakes SnowflakeCollector, clientIDCandid turbotunnel.ClientID) (net.PacketConn, *smux.Session, error) { func newSession(snowflakes SnowflakeCollector) (net.PacketConn, *smux.Session, error) {
// We build a persistent KCP session on a sequence of ephemeral WebRTC // We build a persistent KCP session on a sequence of ephemeral WebRTC
// connections. This dialContext tells RedialPacketConn how to get a new // connections. This dialContext tells RedialPacketConn how to get a new
// WebRTC connection when the previous one dies. Inside each WebRTC // WebRTC connection when the previous one dies. Inside each WebRTC