chiark / gitweb /
wip
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 20 Mar 2017 09:17:17 +0000 (09:17 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 20 Mar 2017 09:17:17 +0000 (09:17 +0000)
server

diff --git a/server b/server
index 3abebe9..de21452 100755 (executable)
--- a/server
+++ b/server
@@ -296,11 +296,11 @@ class IphttpResource(twisted.web.resource.Resource):
     c.new_request(request)
 
   def render_GET(self, request):
-    return '<html><body>hippotit</body></html>'
+    return b'<html><body>hippotit</body></html>'
 
 def start_http():
   resource = IphttpResource()
-  sitefactory = twisted.web.server.Site(resource)
+  site = twisted.web.server.Site(resource)
   for addrspec in cfg.get('server','addrs').split():
     try:
       addr = ipaddress.IPv4Address(addrspec)
@@ -309,7 +309,7 @@ def start_http():
       addr = ipaddress.IPv6Address(addrspec)
       endpointfactory = twisted.internet.endpoints.TCP6ServerEndpoint
     ep = endpointfactory(reactor, cfg.getint('server','port'), addr)
-    crash_on_defer(ep.listen(sitefactory))
+    crash_on_defer(ep.listen(site))
 
 #---------- config and setup ----------