chiark / gitweb /
wip
[hippotat.git] / client
diff --git a/client b/client
index 543d2f5a092bdca876f3de8fcc4fdf3347c6ea57..fcdc665224110a3ae1d27a43e6e4814e9b68852c 100755 (executable)
--- a/client
+++ b/client
@@ -61,7 +61,7 @@ def outbound(packet, saddr, daddr):
 class ResponseConsumer(twisted.internet.protocol.Protocol):
   def __init__(self, req):
     self._req = req
-    self._ssd = SlipStreamDecoder(queue_inbound)
+    self._ssd = SlipStreamDecoder('req %s' % id(req), queue_inbound)
     self._log(DBG.HTTP_CTRL, '__init__')
 
   def _log(self, dflag, msg, **kwargs):
@@ -70,9 +70,9 @@ class ResponseConsumer(twisted.internet.protocol.Protocol):
   def dataReceived(self, data):
     self._log(DBG.HTTP_CTRL, 'dataReceived', d=data)
     try:
-      self._ssd.inputdata(mime_translate(data))
+      self._ssd.inputdata(data)
     except Exception as e:
-      self._asyncfailure(e)
+      self._handleexception()
 
   def connectionMade(self):
     self._log(DBG.HTTP_CTRL, 'connectionMade')
@@ -85,7 +85,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))