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

[tor-commits] [ooni-probe/master] Handle responseNeverReceived failure



commit 62d50ea8a826c2da3fbd17d7d184b5540a001239
Author: Arturo Filastò <art@xxxxxxxxx>
Date:   Mon Nov 26 12:25:42 2012 +0100

    Handle responseNeverReceived failure
---
 ooni/templates/httpt.py |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/ooni/templates/httpt.py b/ooni/templates/httpt.py
index 0d53ebe..2a368a0 100644
--- a/ooni/templates/httpt.py
+++ b/ooni/templates/httpt.py
@@ -14,7 +14,7 @@ from twisted.internet.ssl import ClientContextFactory
 from twisted.internet import reactor
 from twisted.internet.error import ConnectionRefusedError, DNSLookupError, TCPTimedOutError
 
-from twisted.web._newclient import Request, Response
+from twisted.web._newclient import Request, Response, ResponseNeverReceived
 
 from ooni.nettest import NetTestCase
 from ooni.utils import log
@@ -309,8 +309,12 @@ class HTTPTest(NetTestCase):
                 self.report['failure'] = 'dns_lookup_error'
 
             elif isinstance(failure.value, TCPTimedOutError):
-                log.err("DNS lookup failure")
+                log.err("TCP Timed Out Error")
                 self.report['failure'] = 'tcp_timed_out_error'
+
+            elif isinstance(failure.value, ResponseNeverReceived):
+                log.err("Response Never Received")
+                self.report['failure'] = 'response_never_received'
             return
 
         d = agent.request(request['method'], request['url'], headers,

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