[tor-commits] [snowflake/master] fix travis test and remove unused badge member

serene at torproject.org serene at torproject.org
Sun Feb 7 01:29:25 UTC 2016


commit 10d24accad1c10b5ce42e4b09855b7bcb7afa986
Author: Serene Han <keroserene+git at gmail.com>
Date:   Wed Feb 3 21:51:25 2016 -0800

    fix travis test and remove unused badge member
---
 proxy/snowflake.coffee      | 22 ++++------------------
 proxy/snowflake_test.coffee |  1 +
 2 files changed, 5 insertions(+), 18 deletions(-)

diff --git a/proxy/snowflake.coffee b/proxy/snowflake.coffee
index a0cce74..74f6a6e 100644
--- a/proxy/snowflake.coffee
+++ b/proxy/snowflake.coffee
@@ -38,9 +38,6 @@ config = {
   ]
 }
 
-# TODO: Implement
-class Badge
-
 # Janky state machine
 MODE =
   INIT:              0
@@ -57,21 +54,10 @@ class Snowflake
   proxyPair: null
 
   rateLimit: null
-  badge: null
-  $badge: null
   state: MODE.INIT
   retries: 0
 
   constructor: (@broker) ->
-    if HEADLESS
-      # No badge
-    else if DEBUG
-      @$badge = debug_div
-    else
-      @badge = new Badge()
-      @$badgem = @badge.elem
-    @$badge.setAttribute('id', 'snowflake-badge') if (@$badge)
-
     rateLimitBytes = undefined
     if 'off' != query['ratelimit']
       rateLimitBytes = Params.getByteCount(query, 'ratelimit',
@@ -144,14 +130,14 @@ class Snowflake
     pair.onCleanup = (event) =>
       # Delete from the list of active proxy pairs.
       @proxyPairs.splice(@proxyPairs.indexOf(pair), 1)
-      @badge.endProxy() if @badge
+      # @badge.endProxy() if @badge
     try
       pair.begin()
     catch err
       log 'ERROR: ProxyPair exception while connecting.'
       log err
       return
-    @badge.beginProxy if @badge
+    # @badge.beginProxy if @badge
 
   cease: ->
     while @proxyPairs.length > 0
@@ -160,12 +146,12 @@ class Snowflake
   disable: ->
     log 'Disabling Snowflake.'
     @cease()
-    @badge.disable() if @badge
+    # @badge.disable() if @badge
 
   die: ->
     log 'Snowflake died.'
     @cease()
-    @badge.die() if @badge
+    # @badge.die() if @badge
 
   # Close all existing ProxyPairs and begin finding new clients from scratch.
   reset: ->
diff --git a/proxy/snowflake_test.coffee b/proxy/snowflake_test.coffee
index 1f027e7..624257a 100644
--- a/proxy/snowflake_test.coffee
+++ b/proxy/snowflake_test.coffee
@@ -1,4 +1,5 @@
 window = {}
+ui = {}
 
 VERBOSE = false
 VERBOSE = true if process.argv.indexOf('-v') >= 0





More information about the tor-commits mailing list