chiark / gitweb /
fixes
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 1 Apr 2017 11:40:59 +0000 (12:40 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 1 Apr 2017 11:40:59 +0000 (12:40 +0100)
client
hippotat/__init__.py
server

diff --git a/client b/client
index 931cb1f4c5fdcdd983407a2d9d7835d4e7bf6baf..ce5e8564b06f95276858d0ef426e9e919fdea2f9 100755 (executable)
--- a/client
+++ b/client
@@ -48,7 +48,7 @@ outstanding = 0
 def start_client():
   global queue
   global agent
 def start_client():
   global queue
   global agent
-  queue = PacketQueue(c.max_queue_time)
+  queue = PacketQueue('up', c.max_queue_time)
   agent = twisted.web.client.Agent(reactor, connectTimeout = c.http_timeout)
 
 def outbound(packet, saddr, daddr):
   agent = twisted.web.client.Agent(reactor, connectTimeout = c.http_timeout)
 
 def outbound(packet, saddr, daddr):
@@ -112,7 +112,7 @@ def check_outbound():
             mime_translate(d)                           + crlf +
             b'--b--'                                    + crlf)
 
             mime_translate(d)                           + crlf +
             b'--b--'                                    + crlf)
 
-    print('REQUESTING ', mime, file=sys.stderr)
+    log_debug(DBG.HTTP_FULL, 'requesting: ' + str(mime))
 
     hh = { 'User-Agent': ['hippotat'],
            'Content-Type': ['multipart/form-data; boundary="b"'] }
 
     hh = { 'User-Agent': ['hippotat'],
            'Content-Type': ['multipart/form-data; boundary="b"'] }
index 064909100fbe409fe30ee67b772c902140060443..22c92dcf0f4b05d67a8a5e1440d57a0976c732ec 100644 (file)
@@ -37,6 +37,7 @@ class DBG(twisted.python.constants.Names):
   INIT = NamedConstant()
   QUEUE = NamedConstant()
   QUEUE_CTRL = NamedConstant()
   INIT = NamedConstant()
   QUEUE = NamedConstant()
   QUEUE_CTRL = NamedConstant()
+  HTTP_FULL = NamedConstant()
 
 _hex_codec = codecs.getencoder('hex_codec')
 
 
 _hex_codec = codecs.getencoder('hex_codec')
 
diff --git a/server b/server
index 19a04d2b55a93d1a0e50b413e5d4b8f0089f78a3..029d064d44f962da66653432c7436e7733dc7408 100755 (executable)
--- a/server
+++ b/server
@@ -168,6 +168,9 @@ def log_http(desca, msg):
 class IphttpResource(twisted.web.resource.Resource):
   isLeaf = True
   def render_POST(self, request):
 class IphttpResource(twisted.web.resource.Resource):
   isLeaf = True
   def render_POST(self, request):
+    log_debug(DBG.HTTP_FULL,
+              'req recv: ' + repr(request) + ' ' + repr(request.args),
+              idof=id(request))
     desca = {'d': None}
     try: process_request(request, desca)
     except Exception as e:
     desca = {'d': None}
     try: process_request(request, desca)
     except Exception as e: