From 2a5e4f3ef6c1a36092300ef540fa1d7f7ab3ccb8 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Thu, 7 Dec 2006 12:47:40 -0700 Subject: [PATCH] allow webfront to use a strports port specification --- allmydata/client.py | 2 +- allmydata/webish.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/allmydata/client.py b/allmydata/client.py index 122166c3..360cdc93 100644 --- a/allmydata/client.py +++ b/allmydata/client.py @@ -37,7 +37,7 @@ class Client(node.Node, Referenceable): WEBPORTFILE = os.path.join(self.basedir, self.WEBPORTFILE) if os.path.exists(WEBPORTFILE): f = open(WEBPORTFILE, "r") - webport = int(f.read()) + webport = f.read() # strports string f.close() self.add_service(WebishServer(webport)) self.queen_pburl = None diff --git a/allmydata/webish.py b/allmydata/webish.py index 2346e0f9..7dcb332e 100644 --- a/allmydata/webish.py +++ b/allmydata/webish.py @@ -1,5 +1,5 @@ -from twisted.application import service, internet +from twisted.application import service, strports from twisted.web import static, resource, server from twisted.python import util, log from nevow import inevow, rend, loaders, appserver, url, tags as T @@ -18,7 +18,6 @@ class IClient(Interface): class WebishServer(service.MultiService): name = "webish" - WEBPORTFILE = "webport" def __init__(self, webport): service.MultiService.__init__(self) @@ -28,7 +27,9 @@ class WebishServer(service.MultiService): root.putChild("vdrive", static.Data("sorry, still initializing", "text/plain")) self.site = site = appserver.NevowSite(root) - internet.TCPServer(webport, site).setServiceParent(self) + s = strports.service(webport, site) + s.setServiceParent(self) + self.listener = s # stash it so the tests can query for the portnum def startService(self): service.MultiService.startService(self) -- 2.45.2