chiark / gitweb /
wip, towards target
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 1 Apr 2017 20:09:54 +0000 (21:09 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 1 Apr 2017 20:09:54 +0000 (21:09 +0100)
client
hippotat/__init__.py

diff --git a/client b/client
index 64025919900694a2955e97f298c8477cc62176af..afc792d3fd25ce13910ca455c6c4b178778b6674 100755 (executable)
--- a/client
+++ b/client
@@ -78,8 +78,8 @@ class ResponseConsumer(twisted.internet.protocol.Protocol):
     self._log(DBG.HTTP_CTRL, 'connectionMade')
 
   def connectionLost(self, reason):
-    self._log(DBG.HTTP_CTRL, 'connectionLost')
-    if isinstance(reason, twisted.internet.error.ConnectionDone):
+    self._log(DBG.HTTP_CTRL, 'connectionLost ' + str(reason))
+    if reason.check(twisted.web.client.ResponseDone):
       try: self._ssd.flush()
       except Exception as e:
         self._asyncfailure(e)
@@ -87,11 +87,13 @@ class ResponseConsumer(twisted.internet.protocol.Protocol):
       self._asyncfailure(reason)
 
   def _asyncfailure(self, reason):
+    self._log(DBG.HTTP_CTRL, '_asyncFailure ' + str(reason))
     global outstanding
     outstanding += 1
     req_err(self._req, reason)
 
 def req_ok(req, resp):
+  log_debug(DBG.HTTP_CTRL, 'req_ok ' + str(resp), idof=req)
   rc = ResponseConsumer(req)
   resp.deliverBody(rc)
   req_fin()
index 6286f49bdeae63b1d3a4c1a50b3b95b6de934048..798f5d2bbce4f3f31a8eef9bbec3a83dcc7e250e 100644 (file)
@@ -201,6 +201,7 @@ def start_ipif(command, router):
                        env=None)
 
 def queue_inbound(packet):
+  log_debug(DBG.FLOW, "queue_inbound", d=packet)
   ipif.transport.write(slip.delimiter)
   ipif.transport.write(slip.encode(packet))
   ipif.transport.write(slip.delimiter)