[tor-commits] r24499: {arm} Applying fix for ticket 2812 to arm's TorCtl branch. (arm/resources/TorCtl)

Damian Johnson atagar1 at gmail.com
Tue Mar 29 02:44:34 UTC 2011


Author: atagar
Date: 2011-03-29 02:44:34 +0000 (Tue, 29 Mar 2011)
New Revision: 24499

Modified:
   arm/resources/TorCtl/TorCtl.py
Log:
Applying fix for ticket 2812 to arm's TorCtl branch.



Modified: arm/resources/TorCtl/TorCtl.py
===================================================================
--- arm/resources/TorCtl/TorCtl.py	2011-03-29 02:12:16 UTC (rev 24498)
+++ arm/resources/TorCtl/TorCtl.py	2011-03-29 02:44:34 UTC (rev 24499)
@@ -109,6 +109,7 @@
                   than prompting the user)
   """
   
+  s = None
   try:
     s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
     s.connect((controlAddr, controlPort))
@@ -132,8 +133,11 @@
       print "Connection refused. Is the ControlPort enabled?"
     else: print "Failed to establish socket: %s" % exc
     
+    if s: s.shutdown(socket.SHUT_RDWR)
     return None
   except Exception, exc:
+    if s: s.shutdown(socket.SHUT_RDWR)
+    
     if passphrase and str(exc) == "Unable to authenticate: password incorrect":
       # provide a warning that the provided password didn't work, then try
       # again prompting for the user to enter it



More information about the tor-commits mailing list