aboutsummaryrefslogtreecommitdiff
path: root/proxy
diff options
context:
space:
mode:
authorDavid Fifield <david@bamsoftware.com>2024-01-16 18:36:34 +0000
committerDavid Fifield <david@bamsoftware.com>2024-01-16 18:43:58 +0000
commitd0529141acb706f64e4defebd22a7d8604d831db (patch)
tree6da7233ef5f96c4f40a9b02b8d26cbbb36e159a0 /proxy
parentf7a468e31b6319d47a7ac1be2fa46e377652f0cc (diff)
downloadsnowflake-d0529141acb706f64e4defebd22a7d8604d831db.tar.gz
snowflake-d0529141acb706f64e4defebd22a7d8604d831db.zip
Cosmetic fixes taken from !219.
shelikhoo/dev-udp-performance-rebased branch https://gitlab.torproject.org/shelikhoo/snowflake/-/commits/9dce28cfc2093490473432ffecd9abaab7ebdbdb
Diffstat (limited to 'proxy')
-rw-r--r--proxy/lib/snowflake.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/proxy/lib/snowflake.go b/proxy/lib/snowflake.go
index 0957a29..ca38a3d 100644
--- a/proxy/lib/snowflake.go
+++ b/proxy/lib/snowflake.go
@@ -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 {