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

[or-cvs] r19256: {torflow} Woops, timeouts can happen via this type too. (torflow/trunk/NetworkScanners)



Author: mikeperry
Date: 2009-04-10 01:29:57 -0400 (Fri, 10 Apr 2009)
New Revision: 19256

Modified:
   torflow/trunk/NetworkScanners/soat.py
Log:

Woops, timeouts can happen via this type too.



Modified: torflow/trunk/NetworkScanners/soat.py
===================================================================
--- torflow/trunk/NetworkScanners/soat.py	2009-04-10 03:04:50 UTC (rev 19255)
+++ torflow/trunk/NetworkScanners/soat.py	2009-04-10 05:29:57 UTC (rev 19256)
@@ -153,8 +153,11 @@
       return (e.code, None, [], "", e.__class__.__name__+str(e)) 
   except (ValueError, urllib2.URLError), e:
     plog('WARN', 'The http-request address ' + address + ' is malformed')
-    traceback.print_exc()
-    return (-23.0, None, [], "", e.__class__.__name__+str(e))
+    if str(e) == "<urlopen error timed out>": # Yah, super ghetto...
+      return (-6.0, None, [], "", e.__class__.__name__+str(e)) 
+    else:
+      traceback.print_exc()
+      return (-23.0, None, [], "", e.__class__.__name__+str(e))
   except socks.Socks5Error, e:
     plog('WARN', 'A SOCKS5 error '+str(e.value[0])+' occured for '+address+": "+str(e))
     return (-float(e.value[0]), None, [], "", e.__class__.__name__+str(e))