Commit 8ec8a7cb authored by Cecylia Bocovich's avatar Cecylia Bocovich
Browse files

Pass lock to socksAcceptLoop by reference

This fixes a bug where we were passing the lock by value to
socksAcceptLoop.
parent 3e8947bf
Pipeline #1966 failed with stage
in 27 minutes and 39 seconds
......@@ -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:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment