[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [snowflake/master] Pass lock to socksAcceptLoop by reference



commit 8ec8a7cb635f1eaf36eadff06c653e73fe553817
Author: Cecylia Bocovich <cohosh@xxxxxxxxxxxxxx>
Date:   Wed Dec 16 10:52:19 2020 -0500

    Pass lock to socksAcceptLoop by reference
    
    This fixes a bug where we were passing the lock by value to
    socksAcceptLoop.
---
 client/snowflake.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/client/snowflake.go b/client/snowflake.go
index 55addc1..e293e73 100644
--- a/client/snowflake.go
+++ b/client/snowflake.go
@@ -28,7 +28,7 @@ const (
 )
 
 // Accept local SOCKS connections and pass them to the handler.
-func socksAcceptLoop(ln *pt.SocksListener, tongue sf.Tongue, shutdown chan struct{}, wg sync.WaitGroup) {
+func socksAcceptLoop(ln *pt.SocksListener, tongue sf.Tongue, shutdown chan struct{}, wg *sync.WaitGroup) {
 	defer ln.Close()
 	for {
 		conn, err := ln.AcceptSocks()
@@ -187,7 +187,7 @@ func main() {
 				break
 			}
 			log.Printf("Started SOCKS listener at %v.", ln.Addr())
-			go socksAcceptLoop(ln, dialer, shutdown, wg)
+			go socksAcceptLoop(ln, dialer, shutdown, &wg)
 			pt.Cmethod(methodName, ln.Version(), ln.Addr())
 			listeners = append(listeners, ln)
 		default:

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits