mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Use chunk.byteLength as appropriate for ArrayBuffers.
Without this, running with non-dummy rate limiter (e.g. ?ratelimit=1000) would try to add undefined to a number resulting in NaN.
This commit is contained in:
parent
297ae7b1b8
commit
ab34f8e889
1 changed files with 2 additions and 2 deletions
|
@ -171,7 +171,7 @@ class ProxyPair
|
|||
@relay.bufferedAmount < @MAX_BUFFER &&
|
||||
@c2rSchedule.length > 0
|
||||
chunk = @c2rSchedule.shift()
|
||||
@rateLimit.update chunk.length
|
||||
@rateLimit.update chunk.byteLength
|
||||
@relay.send chunk
|
||||
busy = true
|
||||
# websocket --> WebRTC
|
||||
|
@ -179,7 +179,7 @@ class ProxyPair
|
|||
@client.bufferedAmount < @MAX_BUFFER &&
|
||||
@r2cSchedule.length > 0
|
||||
chunk = @r2cSchedule.shift()
|
||||
@rateLimit.update chunk.length
|
||||
@rateLimit.update chunk.byteLength
|
||||
@client.send chunk
|
||||
busy = true
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue