[tor-commits] [snowflake/master] Fix logging inactive to ui

arlo at torproject.org arlo at torproject.org
Mon Jan 23 20:34:36 UTC 2017


commit 5212eda6b237eaf96dca4e0f370cc20785683244
Author: Arlo Breault <arlolra at gmail.com>
Date:   Mon Jan 23 12:01:23 2017 -0800

    Fix logging inactive to ui
---
 proxy/snowflake.coffee | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/proxy/snowflake.coffee b/proxy/snowflake.coffee
index 1fff686..629c776 100644
--- a/proxy/snowflake.coffee
+++ b/proxy/snowflake.coffee
@@ -206,12 +206,6 @@ log = (msg) ->
 dbg = (msg) -> log msg if DEBUG or snowflake.ui?.debug
 
 init = (isNode) ->
-  cookies = Parse.cookie document.cookie
-  # Do nothing if snowflake has not been opted in.
-  if cookies[COOKIE_NAME] != "1"
-    log 'Not activate. Please click the badge to change options.'
-    return
-
   # Hook up to the debug UI if available.
   ui = if isNode then null else new UI()
   silenceNotifications = Params.getBool(query, 'silent', false)
@@ -219,6 +213,12 @@ init = (isNode) ->
   broker = new Broker brokerUrl
   snowflake = new Snowflake broker, ui
 
+  cookies = Parse.cookie document.cookie
+  # Do nothing if snowflake has not been opted in.
+  if cookies[COOKIE_NAME] != "1"
+    log 'Not activate. Please click the badge to change options.'
+    return
+
   log '== snowflake proxy =='
   log 'Copy-Paste mode detected.' if COPY_PASTE_ENABLED
   dbg 'Contacting Broker at ' + broker.url if not COPY_PASTE_ENABLED





More information about the tor-commits mailing list