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

[tor-commits] [ooni-probe/master] add success key to the report after doRequest



commit 36c4e194b4597323cdac78aac798e9945e922429
Author: juga0 <juga>
Date:   Tue Dec 22 21:14:21 2015 +0000

    add success key to the report after doRequest
---
 ooni/nettests/third_party/psiphon.py | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/ooni/nettests/third_party/psiphon.py b/ooni/nettests/third_party/psiphon.py
index 3129d5e..94dfa51 100644
--- a/ooni/nettests/third_party/psiphon.py
+++ b/ooni/nettests/third_party/psiphon.py
@@ -116,7 +116,19 @@ connect(False)
                             usePTY=1)
 
         def callDoRequest(_):
-            return self.doRequest(self.url)
+            log.debug("PsiphonTest.callDoRequest: %r" %(_,))
+            d = self.doRequest(self.url)
+            def addSuccessToReport(res):
+                log.debug("PsiphonTest.callDoRequest.addSuccessToReport")
+                self.report['success'] = True
+                return res
+            d.addCallback(addSuccessToReport)
+            def addFailureToReport(res):
+                log.debug("PsiphonTest.callDoRequest.addFailureToReport. res=%r" % (res,))
+                self.report['success'] = False
+                return res
+            d.addErrback(addFailureToReport)
+            return d
         self.bootstrapped.addCallback(callDoRequest)
 
         def cleanup(_):



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