]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
allow webfront to use a strports port specification
authorBrian Warner <warner@allmydata.com>
Thu, 7 Dec 2006 19:47:40 +0000 (12:47 -0700)
committerBrian Warner <warner@allmydata.com>
Thu, 7 Dec 2006 19:47:40 +0000 (12:47 -0700)
allmydata/client.py
allmydata/webish.py

index 122166c3a9d08c41522a437750a7e5d4274f6aba..360cdc93a4bf467c867e6bafcdea8aad58b5bf3f 100644 (file)
@@ -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
index 2346e0f914213d0aa8f5ac2d7c2442fb8243535f..7dcb332eaead6dea304aa630f7ac8aa659fb3513 100644 (file)
@@ -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)