mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
ensure closing stale remotes from the client side
This commit is contained in:
parent
ea2e052a7d
commit
ac9d49b872
2 changed files with 70 additions and 46 deletions
|
@ -20,6 +20,7 @@ import (
|
|||
const (
|
||||
ReconnectTimeout = 10
|
||||
DefaultSnowflakeCapacity = 1
|
||||
SnowflakeTimeout = 30
|
||||
)
|
||||
|
||||
// When a connection handler starts, +1 is written to this channel; when it
|
||||
|
@ -81,7 +82,7 @@ func handler(socks SocksConnector, snowflakes SnowflakeCollector) error {
|
|||
return errors.New("handler: Received invalid Snowflake")
|
||||
}
|
||||
defer socks.Close()
|
||||
defer snowflake.Reset()
|
||||
defer snowflake.Close()
|
||||
log.Println("---- Handler: snowflake assigned ----")
|
||||
err := socks.Grant(&net.TCPAddr{IP: net.IPv4zero, Port: 0})
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue