mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 11:11:30 -04:00
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:
parent
d8d3170af8
commit
b4f4b29a03
4 changed files with 5 additions and 68 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue