[tor-commits] r24496: {arm} Patch by Fabian to prevent resolution for application querie (arm/trunk/src/util)

Damian Johnson atagar1 at gmail.com
Tue Mar 29 01:53:25 UTC 2011


Author: atagar
Date: 2011-03-29 01:53:24 +0000 (Tue, 29 Mar 2011)
New Revision: 24496

Modified:
   arm/trunk/src/util/connections.py
Log:
Patch by Fabian to prevent resolution for application queries and make the port parsing a little more robust.



Modified: arm/trunk/src/util/connections.py
===================================================================
--- arm/trunk/src/util/connections.py	2011-03-28 21:12:32 UTC (rev 24495)
+++ arm/trunk/src/util/connections.py	2011-03-29 01:53:24 UTC (rev 24496)
@@ -659,7 +659,7 @@
       else: lsofArgs.append("-i tcp:%s" % port)
     
     if lsofArgs:
-      lsofResults = sysTools.call("lsof " + " ".join(lsofArgs))
+      lsofResults = sysTools.call("lsof -n " + " ".join(lsofArgs))
     else: lsofResults = None
     
     if not lsofResults and self.failureCount != -1:
@@ -680,8 +680,8 @@
           
           if "->" in portMap:
             iPort, oPort = portMap.split("->")
-            iPort = iPort.replace("localhost:", "")
-            oPort = oPort.replace("localhost:", "")
+            iPort = iPort.split(":")[1]
+            oPort = oPort.split(":")[1]
             
             # entry belongs to our own process
             if pid == str(os.getpid()):



More information about the tor-commits mailing list