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

[tor-commits] [ooni-probe/master] REABSE



commit d7ef9dd9aa2531b81220956b21a3a029b878a211
Author: Arturo Filastò <art@xxxxxxxxx>
Date:   Sat Jan 4 17:37:54 2014 +0100

    REABSE
---
 ooni/templates/httpt.py |    2 +-
 ooni/utils/net.py       |    2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/ooni/templates/httpt.py b/ooni/templates/httpt.py
index f9b9d36..fdcbc3e 100644
--- a/ooni/templates/httpt.py
+++ b/ooni/templates/httpt.py
@@ -231,7 +231,7 @@ class HTTPTest(NetTestCase):
             self.processResponseHeaders(response_headers_dict)
 
         try:
-            content_length = response.headers.getRawHeaders('content-length')
+            content_length = int(response.headers.getRawHeaders('content-length')[0])
         except IndexError:
             content_length = None
         
diff --git a/ooni/utils/net.py b/ooni/utils/net.py
index 1cc1046..845cf4c 100644
--- a/ooni/utils/net.py
+++ b/ooni/utils/net.py
@@ -65,8 +65,6 @@ class BodyReceiver(protocol.Protocol):
     def __init__(self, finished, content_length=None, body_processor=None):
         self.finished = finished
         self.data = ""
-        if content_length:
-            content_length = int(content_length[0])
         self.bytes_remaining = content_length
         self.body_processor = body_processor
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits