simplify proxypair relay onclose

This commit is contained in:
Serene Han 2016-03-13 22:58:11 -07:00
parent 5e318b6219
commit 3339b9f172
2 changed files with 24 additions and 35 deletions

View file

@ -131,13 +131,9 @@ class Snowflake
pair.onCleanup = (event) =>
# Delete from the list of active proxy pairs.
@proxyPairs.splice(@proxyPairs.indexOf(pair), 1)
try
pair.begin()
catch err
log 'ERROR: ProxyPair exception while connecting.'
log err
return
pair.begin()
# Stop all proxypairs.
cease: ->
while @proxyPairs.length > 0
@proxyPairs.pop().close()