chiark / gitweb /
wip, towards target
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 1 Apr 2017 19:51:58 +0000 (20:51 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 1 Apr 2017 19:51:58 +0000 (20:51 +0100)
client

diff --git a/client b/client
index 2765fa5..e0d6cf8 100755 (executable)
--- a/client
+++ b/client
@@ -89,14 +89,14 @@ class ResponseConsumer(twisted.internet.protocol.Protocol):
   def _asyncfailure(self, reason):
     global outstanding
     outstanding += 1
-    req_err(reason)
+    req_err(self._req, reason)
 
 def req_ok(req, resp):
   rc = ResponseConsumer(req)
   resp.deliverBody(rc)
   req_fin()
 
-def req_err(err):
+def req_err(req, err):
   print(err, file=sys.stderr)
   reactor.callLater(c.http_retry, req_fin)
 
@@ -108,7 +108,7 @@ def req_fin(*args):
 def asyncfailure(reason):
   global outstanding
   outstanding += 1
-  req_err(reason)
+  req_err(None, reason)
 
 def check_outbound():
   global outstanding
@@ -161,7 +161,7 @@ def check_outbound():
                         producer)
     req.addTimeout(c.http_timeout, reactor)
     req.addCallback((lambda resp: req_ok(req, resp)))
-    req.addErrback(req_err)
+    req.addErrback((lambda err: req_err(req, err)))
     outstanding += 1
 
 common_startup()