Move snowflake ConnectLoop inside SOCKS Handler

Bug #21314: maintains a separate snowflake connect loop per SOCKS
connection. This way, if Tor decides to stop using Snowflake, Snowflake
will stop using the client's network.
This commit is contained in:
Cecylia Bocovich 2020-08-11 13:22:16 -04:00
parent d5ae7562ac
commit 1364d7d45b
3 changed files with 41 additions and 37 deletions

View file

@ -157,11 +157,11 @@ func TestSnowflakeClient(t *testing.T) {
SkipConvey("Handler Grants correctly", func() {
socks := &FakeSocksConn{}
snowflakes := &FakePeers{}
broker := &BrokerChannel{Host: "test"}
d := NewWebRTCDialer(broker, nil)
So(socks.rejected, ShouldEqual, false)
snowflakes.toRelease = nil
Handler(socks, snowflakes)
Handler(socks, d)
So(socks.rejected, ShouldEqual, true)
})
})