chiark / gitweb /
wip, towards target
[hippotat.git] / client
diff --git a/client b/client
index 467afd60885ce5c50e4ccb5aa751af4307b3834a..6af84cd1fd9c507c2421b7ec4cbdb86b7b10194c 100755 (executable)
--- a/client
+++ b/client
@@ -68,8 +68,11 @@ class ResponseConsumer(twisted.internet.protocol.Protocol):
     log_debug(dflag, 'RC ' + msg, idof=self._req, **kwargs)
 
   def dataReceived(self, data):
-    try: self._ssd.inputdata(mime_translate(data))
-    except Exception as e: asyncfailure(e)
+    self._log(DBG.HTTP_CTRL, 'dataReceived', d=data)
+    try:
+      self._ssd.inputdata(mime_translate(data))
+    except Exception as e:
+      self._asyncfailure(e)
 
   def connectionMade(self):
     self._log(DBG.HTTP_CTRL, 'connectionMade')
@@ -80,7 +83,12 @@ class ResponseConsumer(twisted.internet.protocol.Protocol):
       try: self._ssd.flush()
       except Exception as e: asyncfailure(e)
     else:
-      asyncfailure(reason)
+      self._asyncfailure(reason)
+
+  def _asyncfailure(self, reason):
+    global outstanding
+    outstanding += 1
+    req_err(reason)
 
 def req_ok(req, resp):
   rc = ResponseConsumer(req)