[tor-commits] [arm/release] Allowing for multiple GETINFO arguments

atagar at torproject.org atagar at torproject.org
Sun Sep 25 21:38:30 UTC 2011


commit 2add4d9eb8fc53166a0d62a3881620ea1dcc22cd
Author: Damian Johnson <atagar at torproject.org>
Date:   Sun Sep 18 20:20:45 2011 -0700

    Allowing for multiple GETINFO arguments
    
    The control spec allows for multiple GETINFO arguments so respecting this,
    though including a newline between results so it's actually readable (yea, it's
    not what the control-spec says but I'm just a crazy rebel like that).
---
 src/util/torInterpretor.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/util/torInterpretor.py b/src/util/torInterpretor.py
index f0d0639..963a465 100644
--- a/src/util/torInterpretor.py
+++ b/src/util/torInterpretor.py
@@ -658,8 +658,9 @@ class ControlInterpretor:
       
       if cmd == "GETINFO":
         try:
-          response = conn.getInfo(arg, suppressExc = False)
-          outputEntry.append((response, OUTPUT_FORMAT))
+          for param in arg.split():
+            response = conn.getInfo(param, suppressExc = False)
+            outputEntry.append((response + "\n", OUTPUT_FORMAT))
         except Exception, exc:
           outputEntry.append((str(exc), ERROR_FORMAT))
       elif cmd == "SETCONF" or cmd == "RESETCONF":





More information about the tor-commits mailing list