[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r19462: {torflow} Add some debug lings for printing total read bytes and Conte (torflow/trunk/NetworkScanners)
Author: mikeperry
Date: 2009-05-06 23:26:47 -0400 (Wed, 06 May 2009)
New Revision: 19462
Modified:
torflow/trunk/NetworkScanners/speedracer.py
Log:
Add some debug lings for printing total read bytes and
Content Length headers.
Modified: torflow/trunk/NetworkScanners/speedracer.py
===================================================================
--- torflow/trunk/NetworkScanners/speedracer.py 2009-05-06 11:36:12 UTC (rev 19461)
+++ torflow/trunk/NetworkScanners/speedracer.py 2009-05-07 03:26:47 UTC (rev 19462)
@@ -84,7 +84,9 @@
try:
reply = urllib2.urlopen(request)
- reply.read()
+ decl_length = reply.info().get("Content-Length")
+ read_len = len(reply.read())
+ plog("DEBUG", "Read: "+str(read_len)+" of declared "+str(decl_length))
return 1
except (ValueError, urllib2.URLError):
plog('ERROR', 'The http-request address ' + address + ' is malformed')