chiark / gitweb /
wip,
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 21 Mar 2017 20:44:56 +0000 (20:44 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 21 Mar 2017 20:44:56 +0000 (20:44 +0000)
client
hippotat/__init__.py
server
test.cfg

diff --git a/client b/client
index b0250de..b355647 100755 (executable)
--- a/client
+++ b/client
@@ -18,7 +18,6 @@ mtu = 1500
 '''
 
 c.clientv = None
-c.max_outstanding = 
 
 def set_client(ci,cs,pw):
   global password
@@ -38,7 +37,7 @@ def process_cfg():
     c.url = cfg.get('server','url')
   except NoOptionError:
     process_cfg_saddrs()
-    sa = c.saddrs[1].url()
+    sa = c.saddrs[0].url()
 
   process_cfg_clients(set_client)
 
index 6f0d3e8..194dc99 100644 (file)
@@ -6,6 +6,7 @@ signal.signal(signal.SIGINT, signal.SIG_DFL)
 import twisted
 from twisted.internet import reactor
 from twisted.logger import LogLevel
+import twisted.internet.endpoints
 
 import ipaddress
 from ipaddress import AddressValueError
@@ -187,7 +188,8 @@ class ServerAddr():
     return url
     
 def process_cfg_saddrs():
-  port = cfg.getint('server','port')
+  try: port = cfg.getint('server','port')
+  except NoOptionError: port = 80
 
   c.saddrs = [ ]
   for addrspec in cfg.get('server','addrs').split():
diff --git a/server b/server
index fc149c0..6da5be4 100755 (executable)
--- a/server
+++ b/server
@@ -6,7 +6,6 @@ import sys
 import os
 
 import twisted.internet
-import twisted.internet.endpoints
 from twisted.web.server import NOT_DONE_YET
 
 #import twisted.web.server import Site
index 62afbf0..ce2d858 100644 (file)
--- a/test.cfg
+++ b/test.cfg
@@ -7,11 +7,3 @@ network = 192.0.2.0/24
 
 [192.0.2.3]
 password = sesame
-
-# normally only a client would have the [client] section and
-# only a server the other sections
-
-[client]
-server = http://127.0.0.1:8099/
-password = sesame
-virtual = 192.0.2.3