mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Cosmetic fixes taken from !219.
shelikhoo/dev-udp-performance-rebased branch https://gitlab.torproject.org/shelikhoo/snowflake/-/commits/9dce28cfc2093490473432ffecd9abaab7ebdbdb
This commit is contained in:
parent
f7a468e31b
commit
d0529141ac
6 changed files with 32 additions and 23 deletions
|
@ -78,7 +78,7 @@ const (
|
|||
// client is not going to connect
|
||||
dataChannelTimeout = 20 * time.Second
|
||||
|
||||
//Maximum number of bytes to be read from an HTTP request
|
||||
// Maximum number of bytes to be read from an HTTP request
|
||||
readLimit = 100000
|
||||
|
||||
sessionIDLength = 16
|
||||
|
@ -406,11 +406,11 @@ func (sf *SnowflakeProxy) makeWebRTCAPI() *webrtc.API {
|
|||
// candidates is complete and the answer is available in LocalDescription.
|
||||
// Installs an OnDataChannel callback that creates a webRTCConn and passes it to
|
||||
// datachannelHandler.
|
||||
func (sf *SnowflakeProxy) makePeerConnectionFromOffer(sdp *webrtc.SessionDescription,
|
||||
config webrtc.Configuration,
|
||||
dataChan chan struct{},
|
||||
handler func(conn *webRTCConn, remoteAddr net.Addr)) (*webrtc.PeerConnection, error) {
|
||||
|
||||
func (sf *SnowflakeProxy) makePeerConnectionFromOffer(
|
||||
sdp *webrtc.SessionDescription,
|
||||
config webrtc.Configuration, dataChan chan struct{},
|
||||
handler func(conn *webRTCConn, remoteAddr net.Addr),
|
||||
) (*webrtc.PeerConnection, error) {
|
||||
api := sf.makeWebRTCAPI()
|
||||
pc, err := api.NewPeerConnection(config)
|
||||
if err != nil {
|
||||
|
@ -523,9 +523,9 @@ func (sf *SnowflakeProxy) makePeerConnectionFromOffer(sdp *webrtc.SessionDescrip
|
|||
|
||||
// Create a new PeerConnection. Blocks until the gathering of ICE
|
||||
// candidates is complete and the answer is available in LocalDescription.
|
||||
func (sf *SnowflakeProxy) makeNewPeerConnection(config webrtc.Configuration,
|
||||
dataChan chan struct{}) (*webrtc.PeerConnection, error) {
|
||||
|
||||
func (sf *SnowflakeProxy) makeNewPeerConnection(
|
||||
config webrtc.Configuration, dataChan chan struct{},
|
||||
) (*webrtc.PeerConnection, error) {
|
||||
api := sf.makeWebRTCAPI()
|
||||
pc, err := api.NewPeerConnection(config)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue