mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Remove SnowflakeDataChannel interface.
Use *webrtc.DataChannel directly.
This commit is contained in:
parent
32207d6f06
commit
8caa737700
2 changed files with 2 additions and 9 deletions
|
@ -1,7 +1,6 @@
|
||||||
package lib
|
package lib
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io"
|
|
||||||
"net"
|
"net"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -30,9 +29,3 @@ type SocksConnector interface {
|
||||||
Reject() error
|
Reject() error
|
||||||
net.Conn
|
net.Conn
|
||||||
}
|
}
|
||||||
|
|
||||||
// Interface for the Snowflake's transport. (Typically just webrtc.DataChannel)
|
|
||||||
type SnowflakeDataChannel interface {
|
|
||||||
io.Closer
|
|
||||||
Send([]byte) error
|
|
||||||
}
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ type WebRTCPeer struct {
|
||||||
id string
|
id string
|
||||||
config *webrtc.Configuration
|
config *webrtc.Configuration
|
||||||
pc *webrtc.PeerConnection
|
pc *webrtc.PeerConnection
|
||||||
transport SnowflakeDataChannel // Holds the WebRTC DataChannel.
|
transport *webrtc.DataChannel
|
||||||
broker *BrokerChannel
|
broker *BrokerChannel
|
||||||
|
|
||||||
offerChannel chan *webrtc.SessionDescription
|
offerChannel chan *webrtc.SessionDescription
|
||||||
|
@ -321,7 +321,7 @@ func (c *WebRTCPeer) cleanup() {
|
||||||
if c.pc == nil {
|
if c.pc == nil {
|
||||||
panic("DataChannel w/o PeerConnection, not good.")
|
panic("DataChannel w/o PeerConnection, not good.")
|
||||||
}
|
}
|
||||||
dataChannel.(*webrtc.DataChannel).Close()
|
dataChannel.Close()
|
||||||
} else {
|
} else {
|
||||||
c.lock.Unlock()
|
c.lock.Unlock()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue