chiark / gitweb /
wip, fixes
[hippotat.git] / client
diff --git a/client b/client
index 543d2f5a092bdca876f3de8fcc4fdf3347c6ea57..b5a4db5bf5bb639be691feaa04b65fa100d0ed58 100755 (executable)
--- 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))