[tor-commits] [ooni-probe/master] Fix recursion with proper arrest condition.
art at torproject.org
art at torproject.org
Wed Nov 6 09:12:44 UTC 2013
commit a449e74b5e56430f05187a23e1ae2af9bf7ca414
Author: Arturo Filastò <art at fuffa.org>
Date: Mon Nov 4 10:00:44 2013 +0100
Fix recursion with proper arrest condition.
---
ooni/oonibclient.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ooni/oonibclient.py b/ooni/oonibclient.py
index 6be7c44..1b11347 100644
--- a/ooni/oonibclient.py
+++ b/ooni/oonibclient.py
@@ -54,7 +54,7 @@ class OONIBClient(object):
finished = defer.Deferred()
- def perform_request():
+ def perform_request(attempts):
uri = self.address + urn
headers = {}
d = self.agent.request(method, uri, bodyProducer=bodyProducer)
@@ -70,13 +70,13 @@ class OONIBClient(object):
if attempts < self.retries:
log.err("Lookup failed. Retrying.")
attempts += 1
- perform_request()
+ perform_request(attempts)
else:
log.err("Failed. Giving up.")
finished.errback(err)
d.addErrback(errback, attempts)
- perform_request()
+ perform_request(attempts)
return finished
More information about the tor-commits
mailing list