[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [snowflake/master] Use chunk.byteLength as appropriate for ArrayBuffers.
commit ab34f8e889e9b516f55dc255a8dd125a46725021
Author: David Fifield <david@xxxxxxxxxxxxxxx>
Date: Tue Dec 4 17:11:29 2018 -0700
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.
---
proxy/proxypair.coffee | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/proxy/proxypair.coffee b/proxy/proxypair.coffee
index 4f401b0..d3340ed 100644
--- a/proxy/proxypair.coffee
+++ b/proxy/proxypair.coffee
@@ -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
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits