[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [nyx/master] Don't use inference resolution if proc is unavailable



commit 08dbde23c1b8e9f2415723cb08d882ec7add07c8
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Sat Nov 4 15:27:59 2017 -0700

    Don't use inference resolution if proc is unavailable
    
    Oops. On reflection many platforms (OSX, BSD, etc) lack proc contents so we
    shouldn't attempt to use them when unavailable. Otherwise the connection panel
    will be delayed. Caught thanks to a report on tor-relays@.
---
 nyx/panel/connection.py | 2 --
 nyx/tracker.py          | 9 ++++++---
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/nyx/panel/connection.py b/nyx/panel/connection.py
index ed0ec11..0fb4889 100644
--- a/nyx/panel/connection.py
+++ b/nyx/panel/connection.py
@@ -17,8 +17,6 @@ import nyx.panel
 import nyx.popups
 import nyx.tracker
 
-import stem.util.log
-
 from nyx import nyx_interface, tor_controller
 from nyx.curses import WHITE, NORMAL, BOLD, HIGHLIGHT
 from nyx.menu import MenuItem, Submenu, RadioMenuItem, RadioGroup
diff --git a/nyx/tracker.py b/nyx/tracker.py
index 8ef928a..a108433 100644
--- a/nyx/tracker.py
+++ b/nyx/tracker.py
@@ -510,10 +510,13 @@ class ConnectionTracker(Daemon):
     # resolution. Otherwise connection resolution by inference is the only game
     # in town.
 
+    self._resolvers = []
+
     if tor_controller().get_conf('DisableDebuggerAttachment', None) == '0':
-      self._resolvers = [CustomResolver.INFERENCE] + connection.system_resolvers()
-    else:
-      self._resolvers = [CustomResolver.INFERENCE]
+      self._resolvers = connection.system_resolvers()
+
+    if stem.util.proc.is_available():
+      self._resolvers = [CustomResolver.INFERENCE] + self._resolvers
 
     stem.util.log.info('Operating System: %s, Connection Resolvers: %s' % (os.uname()[0], ', '.join(self._resolvers)))
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits