add a star...
Content-type: text/plain
Author: damoxc
Revision: 5618
Log:
only stop the port/socket if one exists
add a start_reactor=True param to the start method
Diff:
Modified: trunk/deluge/ui/web/server.py
===================================================================
--- trunk/deluge/ui/web/server.py 2009-08-03 19:21:53 UTC (rev 5617)
+++ trunk/deluge/ui/web/server.py 2009-08-03 19:23:27 UTC (rev 5618)
@@ -466,15 +466,16 @@
return 1
SetConsoleCtrlHandler(win_handler)
- def start(self):
+ def start(self, start_reactor=True):
log.info("%s %s.", _("Starting server in PID"), os.getpid())
if self.https:
self.start_ssl()
else:
self.start_normal()
+ self.plugins.enable_plugins()
- self.plugins.enable_plugins()
- reactor.run()
+ if start_reactor:
+ reactor.run()
def start_normal(self):
self.socket = reactor.listenTCP(self.port, self.site)
@@ -491,8 +492,9 @@
self.plugins.disable_plugins()
log.debug("Saving configuration file")
self.config.save()
- self.socket.stopListening()
- self.socket = None
+ if self.socket:
+ self.socket.stopListening()
+ self.socket = None
def shutdown(self, *args):
self.stop()
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"deluge-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/deluge-commit?hl=en
-~----------~----~----~----~------~----~------~--~---