mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-15 08:03:36 -04:00
Initialize arrays when constructing
Otherwise, this is set on the prototype and shared across instances :/ Note the change to the test that highlights this bug. A proxy pair was already created when an earlier test called `beginWebRTC()` but a new Snowflake instance should start with an empty array.
This commit is contained in:
parent
9df66b15b1
commit
3839c2e0b1
3 changed files with 4 additions and 5 deletions
|
@ -10,8 +10,6 @@ Broker with an WebRTC answer.
|
|||
class ProxyPair
|
||||
MAX_BUFFER: 10 * 1024 * 1024
|
||||
pc: null
|
||||
c2rSchedule: []
|
||||
r2cSchedule: []
|
||||
client: null # WebRTC Data channel
|
||||
relay: null # websocket
|
||||
timer: 0
|
||||
|
@ -27,8 +25,9 @@ class ProxyPair
|
|||
- @rateLimit specifies a rate limit on traffic
|
||||
###
|
||||
constructor: (@relayAddr, @rateLimit) ->
|
||||
@active = false
|
||||
@id = Util.genSnowflakeID()
|
||||
@c2rSchedule = []
|
||||
@r2cSchedule = []
|
||||
|
||||
# Prepare a WebRTC PeerConnection and await for an SDP offer.
|
||||
begin: ->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue