mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 14:11:23 -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.
|
||||
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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue