mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Pass lock to socksAcceptLoop by reference
This fixes a bug where we were passing the lock by value to socksAcceptLoop.
This commit is contained in:
parent
3e8947bfc9
commit
8ec8a7cb63
1 changed files with 2 additions and 2 deletions
|
@ -28,7 +28,7 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
// Accept local SOCKS connections and pass them to the handler.
|
// 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()
|
defer ln.Close()
|
||||||
for {
|
for {
|
||||||
conn, err := ln.AcceptSocks()
|
conn, err := ln.AcceptSocks()
|
||||||
|
@ -187,7 +187,7 @@ func main() {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
log.Printf("Started SOCKS listener at %v.", ln.Addr())
|
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())
|
pt.Cmethod(methodName, ln.Version(), ln.Addr())
|
||||||
listeners = append(listeners, ln)
|
listeners = append(listeners, ln)
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue