diff --git a/server.py b/server.py index ea2b067..b9e0635 100644 --- a/server.py +++ b/server.py @@ -122,8 +122,9 @@ def main(): socket.fromfd(sys.stdout.fileno(), socket.AF_INET, socket.SOCK_STREAM)) handlers.append(mux) - routepkt = ''.join('%s,%d\n' % r - for r in routes) + routepkt = '' + for r in routes: + routepkt += '%s,%d\n' % r mux.send(0, ssnet.CMD_ROUTES, routepkt) hw = Hostwatch() diff --git a/ssnet.py b/ssnet.py index 55efa04..932fab4 100644 --- a/ssnet.py +++ b/ssnet.py @@ -247,7 +247,10 @@ class Mux(Handler): return self.chani def amount_queued(self): - return sum(len(b) for b in self.outbuf) + total = 0 + for b in self.outbuf: + total += len(b) + return total def check_fullness(self): if self.fullness > 32768: