diff options
author | Cecylia Bocovich <cohosh@torproject.org> | 2020-12-16 10:52:19 -0500 |
---|---|---|
committer | Cecylia Bocovich <cohosh@torproject.org> | 2020-12-16 10:52:19 -0500 |
commit | 8ec8a7cb635f1eaf36eadff06c653e73fe553817 (patch) | |
tree | 66497dce343cf9736b9dc31b57d636ec79daad56 | |
parent | 3e8947bfc9af1b299bc202d0252245c03ba20f11 (diff) | |
download | snowflake-8ec8a7cb635f1eaf36eadff06c653e73fe553817.tar.gz snowflake-8ec8a7cb635f1eaf36eadff06c653e73fe553817.zip |
Pass lock to socksAcceptLoop by reference
This fixes a bug where we were passing the lock by value to
socksAcceptLoop.
-rw-r--r-- | client/snowflake.go | 4 |
1 files 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: |