X-Git-Url: https://git.distorted.org.uk/~mdw/hippotat/blobdiff_plain/6f387df3234541f1066eff163d18fa6becf59c82..eedc8b30ac92c216d6eef8ff9616bc0cf226a8e6:/client diff --git a/client b/client index 543d2f5..b5a4db5 100755 --- a/client +++ b/client @@ -58,10 +58,12 @@ def outbound(packet, saddr, daddr): queue.append(packet) check_outbound() +def crashy(): assert(False) + class ResponseConsumer(twisted.internet.protocol.Protocol): def __init__(self, req): self._req = req - self._ssd = SlipStreamDecoder(queue_inbound) + self._ssd = SlipStreamDecoder(crashy) self._log(DBG.HTTP_CTRL, '__init__') def _log(self, dflag, msg, **kwargs): @@ -72,7 +74,7 @@ class ResponseConsumer(twisted.internet.protocol.Protocol): try: self._ssd.inputdata(mime_translate(data)) except Exception as e: - self._asyncfailure(e) + self._handleexception() def connectionMade(self): self._log(DBG.HTTP_CTRL, 'connectionMade') @@ -85,7 +87,10 @@ class ResponseConsumer(twisted.internet.protocol.Protocol): try: self._ssd.flush() except Exception as e: - self._asyncfailure(e) + self._handleexception() + + def _handleexception(self): + self._asyncfailure(traceback.format_exc()) def _asyncfailure(self, reason): self._log(DBG.HTTP_CTRL, '_asyncFailure ' + str(reason))