[tor-commits] [stem/master] Interpretor ignored the --interface argument if --socket was also provided

atagar at torproject.org atagar at torproject.org
Mon Jun 23 15:00:13 UTC 2014


commit c1308b33d026ba3c67f43008f992527bb7ffcaa5
Author: Damian Johnson <atagar at torproject.org>
Date:   Sat Jun 21 13:30:41 2014 -0700

    Interpretor ignored the --interface argument if --socket was also provided
    
    When a user specifies an endpoint (either a control port or socket file) we
    only try to connect to that. However, if a user supplies *both* an --interface
    and --socket argument then we ignored the former.
---
 stem/interpreter/__init__.py |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/stem/interpreter/__init__.py b/stem/interpreter/__init__.py
index 31b119f..18c536e 100644
--- a/stem/interpreter/__init__.py
+++ b/stem/interpreter/__init__.py
@@ -83,8 +83,16 @@ def main():
           take_ownership = True,
         )
 
-  control_port = None if args.user_provided_socket else (args.control_address, args.control_port)
-  control_socket = None if args.user_provided_port else args.control_socket
+  control_port = (args.control_address, args.control_port)
+  control_socket = args.control_socket
+
+  # If the user explicitely specified an endpoint then just try to connect to
+  # that.
+
+  if args.user_provided_socket and not args.user_provided_port:
+    control_port = None
+  elif args.user_provided_port and not args.user_provided_socket:
+    control_socket = None
 
   controller = stem.connection.connect(
     control_port = control_port,





More information about the tor-commits mailing list