use webrtcRemotes len for capacity instead of the chan

This commit is contained in:
Serene Han 2016-03-25 17:03:38 -07:00 committed by Arlo Breault
parent 22ace32a71
commit b2d7586cb4

View file

@ -59,7 +59,7 @@ type SnowflakeChannel interface {
// transfer to the Tor SOCKS handler when needed. // transfer to the Tor SOCKS handler when needed.
func SnowflakeConnectLoop() { func SnowflakeConnectLoop() {
for { for {
numRemotes := len(snowflakeChan) numRemotes := len(webrtcRemotes)
if numRemotes >= SnowflakeCapacity { if numRemotes >= SnowflakeCapacity {
log.Println("At Capacity: ", numRemotes, "snowflake. Re-checking in 10s") log.Println("At Capacity: ", numRemotes, "snowflake. Re-checking in 10s")
<-time.After(time.Second * 10) <-time.After(time.Second * 10)