chiark / gitweb /
wip, progress!
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 1 Apr 2017 21:35:08 +0000 (22:35 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 1 Apr 2017 21:35:08 +0000 (22:35 +0100)
hippotat/slip.py
server

index e339f6932c50bd465e0f8238e11420f039e2625c..f13513787857ce7339f91b9dea9d94051fd200fc 100644 (file)
@@ -12,7 +12,7 @@ def encode(packet):
           .replace(end, esc + esc_end))
 
 def decode(data):
-  print('DECODE ', repr(data))
+  #print('DECODE ', repr(data))
   out = []
   for packet in data.split(end):
     pdata = b''
diff --git a/server b/server
index 3bfbc4261affd995355ecdb2e25175522d3dcb65..e5aa67b588878fca227564a896f808e2fd5382f6 100755 (executable)
--- a/server
+++ b/server
@@ -165,6 +165,8 @@ def process_request(request, desca):
 
   log_http(desca, 'processing', idof=id(request), d=d)
 
+  d = mime_translate(d)
+
   cl.process_arriving_data(d)
   cl.new_request(request)
 
@@ -186,7 +188,7 @@ class IphttpResource(twisted.web.resource.Resource):
     try: process_request(request, desca)
     except Exception as e:
       emsg = traceback.format_exc()
-      log_http(desca, 'EXCEPTION ' + emsg)
+      log_http(desca, 'RETURNING EXCEPTION ' + emsg)
       request.setHeader('Content-Type','text/plain; charset="utf-8"')
       request.setResponseCode(400)
       return (emsg + ' # ' + repr(desca) + '\r\n').encode('utf-8')
@@ -230,6 +232,6 @@ def process_cfg():
 
 common_startup()
 process_cfg()
-start_ipif(c.ipif_command, route)
+start_ipif(c.ipif_command, (lambda p,s,d: route(p,"[ipif]",s,d)))
 start_http()
 common_run()