chiark
/
gitweb
/
~ian
/
hippotat.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9aa1104
)
wip, towards target
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sat, 1 Apr 2017 19:39:35 +0000
(20:39 +0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sat, 1 Apr 2017 19:39:35 +0000
(20:39 +0100)
client
patch
|
blob
|
history
diff --git
a/client
b/client
index 829087e3936c8029e7f17d5f8e27fc56877848b1..7b2bf78f678f607e514b0457bbb8c697ba6ef3a1 100755
(executable)
--- a/
client
+++ b/
client
@@
-59,7
+59,9
@@
def outbound(packet, saddr, daddr):
check_outbound()
class ResponseConsumer(twisted.internet.protocol.Protocol):
check_outbound()
class ResponseConsumer(twisted.internet.protocol.Protocol):
- def __init__(self):
+ def __init__(self, req):
+ print('RC INIT', file=sys.stderr)
+ self._req = req
self._ssd = SlipStreamDecoder(queue_inbound)
def dataReceived(self, data):
self._ssd = SlipStreamDecoder(queue_inbound)
def dataReceived(self, data):
@@
-73,8
+75,9
@@
class ResponseConsumer(twisted.internet.protocol.Protocol):
else:
asyncfailure(reason)
else:
asyncfailure(reason)
-def req_ok(resp):
- resp.deliverBody(ResponseConsumer())
+def req_ok(req, resp):
+ rc = ResponseConsumer(req)
+ resp.deliverBody(rc)
req_fin()
def req_err(err):
req_fin()
def req_err(err):
@@
-141,7
+144,8
@@
def check_outbound():
twisted.web.client.Headers(hh),
producer)
req.addTimeout(c.http_timeout, reactor)
twisted.web.client.Headers(hh),
producer)
req.addTimeout(c.http_timeout, reactor)
- req.addCallbacks(req_ok, req_err)
+ req.addCallback((lambda resp: req_ok(req, resp)))
+ req.addErrback(req_err)
outstanding += 1
common_startup()
outstanding += 1
common_startup()