[tor-commits] [snowflake/master] Use lowercase variable names in copyLoop.

dcf at torproject.org dcf at torproject.org
Tue Jan 28 10:06:48 UTC 2020


commit 57d4b0b5bdac10875e8f57cca71a37a74d42f387
Author: David Fifield <david at bamsoftware.com>
Date:   Tue Jan 28 03:01:48 2020 -0700

    Use lowercase variable names in copyLoop.
---
 client/lib/snowflake.go    | 6 +++---
 server-webrtc/snowflake.go | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/client/lib/snowflake.go b/client/lib/snowflake.go
index 50070af..a27c6a5 100644
--- a/client/lib/snowflake.go
+++ b/client/lib/snowflake.go
@@ -48,17 +48,17 @@ func Handler(socks SocksConnector, snowflakes SnowflakeCollector) error {
 
 // Exchanges bytes between two ReadWriters.
 // (In this case, between a SOCKS and WebRTC connection.)
-func copyLoop(SOCKS, WebRTC io.ReadWriter) {
+func copyLoop(socks, webRTC io.ReadWriter) {
 	var wg sync.WaitGroup
 	wg.Add(2)
 	go func() {
-		if _, err := io.Copy(SOCKS, WebRTC); err != nil {
+		if _, err := io.Copy(socks, webRTC); err != nil {
 			log.Printf("copying WebRTC to SOCKS resulted in error: %v", err)
 		}
 		wg.Done()
 	}()
 	go func() {
-		if _, err := io.Copy(WebRTC, SOCKS); err != nil {
+		if _, err := io.Copy(webRTC, socks); err != nil {
 			log.Printf("copying SOCKS to WebRTC resulted in error: %v", err)
 		}
 		wg.Done()
diff --git a/server-webrtc/snowflake.go b/server-webrtc/snowflake.go
index acdf5b1..9ca82cb 100644
--- a/server-webrtc/snowflake.go
+++ b/server-webrtc/snowflake.go
@@ -21,17 +21,17 @@ var ptMethodName = "snowflake"
 var ptInfo pt.ServerInfo
 var logFile *os.File
 
-func copyLoop(WebRTC, ORPort net.Conn) {
+func copyLoop(webRTC, orPort net.Conn) {
 	var wg sync.WaitGroup
 	wg.Add(2)
 	go func() {
-		if _, err := io.Copy(ORPort, WebRTC); err != nil {
+		if _, err := io.Copy(orPort, webRTC); err != nil {
 			log.Printf("copy WebRTC to ORPort error in copyLoop: %v", err)
 		}
 		wg.Done()
 	}()
 	go func() {
-		if _, err := io.Copy(WebRTC, ORPort); err != nil {
+		if _, err := io.Copy(webRTC, orPort); err != nil {
 			log.Printf("copy ORPort to WebRTC error in copyLoop: %v", err)
 		}
 		wg.Done()



More information about the tor-commits mailing list