fix travis test and remove unused badge member

This commit is contained in:
Serene Han 2016-02-03 21:51:25 -08:00
parent 21c38a04ce
commit 10d24accad
2 changed files with 5 additions and 18 deletions

View file

@ -38,9 +38,6 @@ config = {
] ]
} }
# TODO: Implement
class Badge
# Janky state machine # Janky state machine
MODE = MODE =
INIT: 0 INIT: 0
@ -57,21 +54,10 @@ class Snowflake
proxyPair: null proxyPair: null
rateLimit: null rateLimit: null
badge: null
$badge: null
state: MODE.INIT state: MODE.INIT
retries: 0 retries: 0
constructor: (@broker) -> 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 rateLimitBytes = undefined
if 'off' != query['ratelimit'] if 'off' != query['ratelimit']
rateLimitBytes = Params.getByteCount(query, 'ratelimit', rateLimitBytes = Params.getByteCount(query, 'ratelimit',
@ -144,14 +130,14 @@ class Snowflake
pair.onCleanup = (event) => pair.onCleanup = (event) =>
# Delete from the list of active proxy pairs. # Delete from the list of active proxy pairs.
@proxyPairs.splice(@proxyPairs.indexOf(pair), 1) @proxyPairs.splice(@proxyPairs.indexOf(pair), 1)
@badge.endProxy() if @badge # @badge.endProxy() if @badge
try try
pair.begin() pair.begin()
catch err catch err
log 'ERROR: ProxyPair exception while connecting.' log 'ERROR: ProxyPair exception while connecting.'
log err log err
return return
@badge.beginProxy if @badge # @badge.beginProxy if @badge
cease: -> cease: ->
while @proxyPairs.length > 0 while @proxyPairs.length > 0
@ -160,12 +146,12 @@ class Snowflake
disable: -> disable: ->
log 'Disabling Snowflake.' log 'Disabling Snowflake.'
@cease() @cease()
@badge.disable() if @badge # @badge.disable() if @badge
die: -> die: ->
log 'Snowflake died.' log 'Snowflake died.'
@cease() @cease()
@badge.die() if @badge # @badge.die() if @badge
# Close all existing ProxyPairs and begin finding new clients from scratch. # Close all existing ProxyPairs and begin finding new clients from scratch.
reset: -> reset: ->

View file

@ -1,4 +1,5 @@
window = {} window = {}
ui = {}
VERBOSE = false VERBOSE = false
VERBOSE = true if process.argv.indexOf('-v') >= 0 VERBOSE = true if process.argv.indexOf('-v') >= 0