connectionID → clientID.

This commit is contained in:
David Fifield 2024-08-01 21:38:48 +00:00 committed by WofWca
parent a601c2b1fa
commit 568a0999d2
2 changed files with 11 additions and 11 deletions

View file

@ -252,7 +252,7 @@ type WebRTCDialer struct {
eventLogger event.SnowflakeEventReceiver eventLogger event.SnowflakeEventReceiver
proxy *url.URL proxy *url.URL
connectionID turbotunnel.ClientID clientID turbotunnel.ClientID
} }
// Deprecated: Use NewWebRTCDialerWithNatPolicyAndEventsAndProxy instead // Deprecated: Use NewWebRTCDialerWithNatPolicyAndEventsAndProxy instead
@ -324,7 +324,7 @@ func NewWebRTCDialerWithNatPolicyAndEventsAndProxyAndClientID(
eventLogger: eventLogger, eventLogger: eventLogger,
proxy: proxy, proxy: proxy,
connectionID: clientID, clientID: clientID,
} }
} }
@ -332,7 +332,7 @@ func NewWebRTCDialerWithNatPolicyAndEventsAndProxyAndClientID(
func (w WebRTCDialer) Catch() (*WebRTCPeer, error) { func (w WebRTCDialer) Catch() (*WebRTCPeer, error) {
// TODO: [#25591] Fetch ICE server information from Broker. // TODO: [#25591] Fetch ICE server information from Broker.
// TODO: [#25596] Consider TURN servers here too. // TODO: [#25596] Consider TURN servers here too.
return NewWebRTCPeerWithEventsAndProxy(w.webrtcConfig, w.BrokerChannel, w.eventLogger, w.proxy) return NewWebRTCPeerWithNatPolicyAndEventsProxyAndClientID(w.webrtcConfig, w.BrokerChannel, w.natPolicy, w.eventLogger, w.proxy, w.clientID)
} }
// GetMax returns the maximum number of snowflakes to collect. // GetMax returns the maximum number of snowflakes to collect.

View file

@ -47,7 +47,7 @@ type WebRTCPeer struct {
proxy *url.URL proxy *url.URL
activeTransportMode byte activeTransportMode byte
connectionID turbotunnel.ClientID clientID turbotunnel.ClientID
} }
// Deprecated: Use NewWebRTCPeerWithNatPolicyAndEventsAndProxy Instead. // Deprecated: Use NewWebRTCPeerWithNatPolicyAndEventsAndProxy Instead.
@ -99,7 +99,7 @@ func NewWebRTCPeerWithNatPolicyAndEventsAndProxy(
// The creation of the peer handles the signaling to the Snowflake broker, including // The creation of the peer handles the signaling to the Snowflake broker, including
// the exchange of SDP information, the creation of a PeerConnection, and the establishment // the exchange of SDP information, the creation of a PeerConnection, and the establishment
// of a DataChannel to the Snowflake proxy. // of a DataChannel to the Snowflake proxy.
// connectionID is the hinted ID for the connection. // clientID is the hinted ID for the connection.
func NewWebRTCPeerWithNatPolicyAndEventsProxyAndClientID(config *webrtc.Configuration, func NewWebRTCPeerWithNatPolicyAndEventsProxyAndClientID(config *webrtc.Configuration,
broker *BrokerChannel, natPolicy *NATPolicy, eventsLogger event.SnowflakeEventReceiver, proxy *url.URL, broker *BrokerChannel, natPolicy *NATPolicy, eventsLogger event.SnowflakeEventReceiver, proxy *url.URL,
clientID turbotunnel.ClientID, clientID turbotunnel.ClientID,
@ -126,7 +126,7 @@ func NewWebRTCPeerWithNatPolicyAndEventsProxyAndClientID(config *webrtc.Configur
connection.eventsLogger = eventsLogger connection.eventsLogger = eventsLogger
connection.proxy = proxy connection.proxy = proxy
connection.connectionID = clientID connection.clientID = clientID
err := connection.connect(config, broker, natPolicy) err := connection.connect(config, broker, natPolicy)
if err != nil { if err != nil {
@ -325,7 +325,7 @@ func (c *WebRTCPeer) preparePeerConnection(
maxRetransmissionVal := uint16(0) maxRetransmissionVal := uint16(0)
maxRetransmission = &maxRetransmissionVal maxRetransmission = &maxRetransmissionVal
} }
protocol := fmt.Sprintf("%c %s", c.activeTransportMode, c.connectionID.String()) protocol := fmt.Sprintf("%c %s", c.activeTransportMode, c.clientID.String())
dataChannelOptions := &webrtc.DataChannelInit{ dataChannelOptions := &webrtc.DataChannelInit{
Ordered: &ordered, Ordered: &ordered,
Protocol: &protocol, Protocol: &protocol,