Stop counting handlers before terminating.

The requirement to do so is obsolete and has already been removed from
other pluggable transports.

https://bugs.torproject.org/32046
This commit is contained in:
David Fifield 2019-10-11 16:50:25 -06:00
parent d8d3170af8
commit b4f4b29a03
4 changed files with 5 additions and 68 deletions

View file

@ -13,17 +13,9 @@ const (
SnowflakeTimeout = 30
)
// HandlerChan - When a connection handler starts, +1 is written to this channel; when it
// ends, -1 is written.
var HandlerChan = make(chan int)
// Given an accepted SOCKS connection, establish a WebRTC connection to the
// remote peer and exchange traffic.
func Handler(socks SocksConnector, snowflakes SnowflakeCollector) error {
HandlerChan <- 1
defer func() {
HandlerChan <- -1
}()
// Obtain an available WebRTC remote. May block.
snowflake := snowflakes.Pop()
if nil == snowflake {