mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 11:11:30 -04:00
Allow handling multiple SOCKS connections simultaneously.
Close the SOCKS connection in the same function that opens it.
This commit is contained in:
parent
20ac2029fd
commit
dfb83c6606
2 changed files with 7 additions and 5 deletions
|
@ -57,10 +57,13 @@ func socksAcceptLoop(ln *pt.SocksListener, snowflakes sf.SnowflakeCollector) {
|
|||
break
|
||||
}
|
||||
log.Printf("SOCKS accepted: %v", conn.Req)
|
||||
err = sf.Handler(conn, snowflakes)
|
||||
if err != nil {
|
||||
log.Printf("handler error: %s", err)
|
||||
}
|
||||
go func() {
|
||||
defer conn.Close()
|
||||
err = sf.Handler(conn, snowflakes)
|
||||
if err != nil {
|
||||
log.Printf("handler error: %s", err)
|
||||
}
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue