[tor-commits] [snowflake/master] Fixed linting errors/warnings and tests
cohosh at torproject.org
cohosh at torproject.org
Tue Jul 2 14:11:01 UTC 2019
commit 788f2a595fa5daf076e08b80c9476cb0a1064c37
Author: Cecylia Bocovich <cohosh at torproject.org>
Date: Thu Jun 27 09:28:36 2019 -0400
Fixed linting errors/warnings and tests
The test failure was due to pollBorker waiting the full 5 seconds before
polling for the first time.
The lint errors were some trailing whitespace and unecessary fat arrows
---
proxy/snowflake.coffee | 8 +++++---
proxy/ui.coffee | 2 +-
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/proxy/snowflake.coffee b/proxy/snowflake.coffee
index b86e0b7..30f1d6b 100644
--- a/proxy/snowflake.coffee
+++ b/proxy/snowflake.coffee
@@ -55,7 +55,9 @@ class Snowflake
@makeProxyPair @relayAddr
log 'ProxyPair Slots: ' + @proxyPairs.length
log 'Snowflake IDs: ' + (@proxyPairs.map (p) -> p.id).join ' | '
- @pollInterval = setInterval((=> @pollBroker()), config.defaultBrokerPollInterval)
+ @pollBroker()
+ @pollInterval = setInterval((=> @pollBroker()),
+ config.defaultBrokerPollInterval)
log @pollInterval
# Regularly poll Broker for clients to serve until this snowflake is
@@ -72,9 +74,9 @@ class Snowflake
msg += '[retries: ' + @retries + ']' if @retries > 0
@ui.setStatus msg
recv = @broker.getClientOffer pair.id
- recv.then (desc) =>
+ recv.then (desc) ->
@receiveOffer pair, desc
- , (err) =>
+ , (err) ->
pair.active = false
@retries++
diff --git a/proxy/ui.coffee b/proxy/ui.coffee
index fa45823..a47e224 100644
--- a/proxy/ui.coffee
+++ b/proxy/ui.coffee
@@ -82,7 +82,7 @@ class WebExtUI extends UI
port.onDisconnect.addListener @onDisconnect
port.onMessage.addListener @onMessage
@postActive()
-
+
onMessage: (m) =>
@enabled = m.enabled
update()
More information about the tor-commits
mailing list