From: Ian Jackson Date: Thu, 23 Mar 2017 00:19:38 +0000 (+0000) Subject: wip X-Git-Url: https://git.distorted.org.uk/~mdw/hippotat/commitdiff_plain/62b51bcf91b1b61b6417fb794272528f2673f3ff wip --- diff --git a/client b/client index 48b635a..c878d72 100755 --- a/client +++ b/client @@ -51,8 +51,20 @@ def outbound(packet, saddr, daddr): queue.append(packet) check_outbound() +class ResponseConsumer(twisted.internet.protocol.Protocol): + def __init__(self): + self._ssd = SlipStreamDecoder(queue_inbound) + def dataReceived(self, data): + self._ssd.inputdata(mime_translate(data)) + def connectionMade(self): pass + def connectionLost(self, reason): + if isinstance(reason, twisted.internet.error.ConnectionDone): + self._ssd.flush() + else: + print(reason, file=sys.stderr) + def req_ok(resp): - + resp.deliverBody(ResponseConsumer()) def req_err(err): print(err, >>sys.stderr)