X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=hippotat.git;a=blobdiff_plain;f=client;h=e4e5eae7a01df3e180be74d170b6404f37a78f6f;hp=5dbae1c6bbc3255b2ef7d2017579d74140d916b3;hb=3393242040c461d71187af33fb0338036784e513;hpb=14c6d55c17a81e119a038980067d93078a4cde75 diff --git a/client b/client index 5dbae1c..e4e5eae 100755 --- a/client +++ b/client @@ -70,13 +70,22 @@ class ResponseConsumer(twisted.internet.protocol.Protocol): def dataReceived(self, data): try: self._ssd.inputdata(mime_translate(data)) except Exception as e: asyncfailure(e) - def connectionMade(self): pass + + def connectionMade(self): + self._log(DBG.HTTP_CTRL, 'connectionMade') + def connectionLost(self, reason): + self._log(DBG.HTTP_CTRL, 'connectionLost') if isinstance(reason, twisted.internet.error.ConnectionDone): 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)