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

[tor-commits] [ooni-probe/master] psiphon: fix bug that psiphon hangs ooniprobe -ng



commit 85ae20219c13a19e26896d867ea121fdf24ccc0e
Author: Simone Basso <bassosimone@xxxxxxxxx>
Date:   Sun Nov 15 16:58:37 2015 +0100

    psiphon: fix bug that psiphon hangs ooniprobe -ng
    
    Marked my fix with XXX because I'm not sure whether this is
    the proper approach, or whether it would be better to work on
    a patch to teach ooniprobe's core to deal with that case.
    
    For now, and given that a psiphon MVP must be delivered as
    soon as possible, this fix will do.
---
 ooni/nettests/third_party/psiphon.py | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/ooni/nettests/third_party/psiphon.py b/ooni/nettests/third_party/psiphon.py
index 637a505..543e856 100644
--- a/ooni/nettests/third_party/psiphon.py
+++ b/ooni/nettests/third_party/psiphon.py
@@ -95,12 +95,18 @@ connect(False)
         log.debug('PsiphonTest.test_psiphon')
 
         if not os.path.exists(self.psiphonpath):
-            log.debug('psiphon path does not exists, is it installed?')
+            log.err('psiphon path does not exists, is it installed?')
             self.report['success'] = False
             self.report['psiphon_installed'] = False
             log.debug("Adding %s to report" % self.report)
-            #FIXME: this completes the test but ooni doesn't stop running, why?
-            return defer.succeed(None)
+            # XXX: the original code written by juga0 readed
+            #     > return defer.succeed(None)
+            # but this caused `ooniprobe -ng` to hang forever, so I
+            # rewrote the code to return a deferred and simulate calling
+            # its callback method, to trigger an event.
+            #     -sbs
+            reactor.callLater(0.0, self.bootstrapped.callback, None)
+            return self.bootstrapped
 
         self.report['psiphon_installed'] = True
         log.debug("Adding %s to report" % self.report)



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