summaryrefslogtreecommitdiffstats
path: root/module/web
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-01-04 11:57:50 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-01-04 11:57:50 +0100
commit3ff31b5c10b69f687aeb0d4fdd0a79d144cac79b (patch)
tree362e004891e9189e520e8424f32e78a92ffbe5e4 /module/web
parentimport fix for py 2.5 (diff)
downloadpyload-3ff31b5c10b69f687aeb0d4fdd0a79d144cac79b.tar.xz
removed unneeded stuff
Diffstat (limited to 'module/web')
-rw-r--r--module/web/ServerThread.py14
-rw-r--r--module/web/webinterface.py14
2 files changed, 8 insertions, 20 deletions
diff --git a/module/web/ServerThread.py b/module/web/ServerThread.py
index b4854e1f4..dc30f4bc5 100644
--- a/module/web/ServerThread.py
+++ b/module/web/ServerThread.py
@@ -63,14 +63,11 @@ class WebServer(threading.Thread):
log.warning(_("Of course you need to be familiar with linux and know how to compile software"))
self.server = "builtin"
- # threaded is the new default server
- if self.server == "builtin":
- self.server = "threaded"
try:
if self.server == "fastcgi":
self.start_fcgi()
- elif self.server == "threaded":
+ elif self.server in ("threaded", "builtin"):
self.start_threaded()
elif self.server == "lightweight":
self.start_lightweight()
@@ -86,8 +83,8 @@ class WebServer(threading.Thread):
if self.https:
log.warning(_("This server offers no SSL, please consider using threaded instead"))
- log.info(_("Starting builtin webserver: %(host)s:%(port)d") % {"host": self.host, "port": self.port})
- webinterface.run_simple(host=self.host, port=self.port)
+ log.info(_("Starting fallback webserver: %(host)s:%(port)d") % {"host": self.host, "port": self.port})
+ webinterface.run_server(host=self.host, port=self.port)
def start_threaded(self):
if self.https:
@@ -105,10 +102,11 @@ class WebServer(threading.Thread):
def noop(*args, **kwargs):
pass
+ # Monkey patch signal handler, it does not work from threads
ThreadedServer._installSignalHandlers = noop
log.info(_("Starting fastcgi server: %(host)s:%(port)d") % {"host": self.host, "port": self.port})
- webinterface.run_fcgi(host=self.host, port=self.port)
+ webinterface.run_server(host=self.host, port=self.port, server="flup")
def start_lightweight(self):
@@ -117,7 +115,7 @@ class WebServer(threading.Thread):
log.info(
_("Starting lightweight webserver (bjoern): %(host)s:%(port)d") % {"host": self.host, "port": self.port})
- webinterface.run_lightweight(host=self.host, port=self.port)
+ webinterface.run_server(host=self.host, port=self.port, server="bjoern")
# check if an error was raised for n seconds
diff --git a/module/web/webinterface.py b/module/web/webinterface.py
index 850ed5bdc..0fdf3c2ab 100644
--- a/module/web/webinterface.py
+++ b/module/web/webinterface.py
@@ -127,12 +127,8 @@ import api_app
# Server Adapter
-def run_simple(host="0.0.0.0", port="8000"):
- run(app=web, host=host, port=port, quiet=True)
-
-
-def run_lightweight(host="0.0.0.0", port="8000"):
- run(app=web, host=host, port=port, quiet=True, server="bjoern")
+def run_server(host="0.0.0.0", port="8000", server="wsgiref"):
+ run(app=web, host=host, port=port, quiet=True, server=server)
def run_threaded(host="0.0.0.0", port="8000", threads=6, cert="", key=""):
@@ -149,11 +145,5 @@ def run_threaded(host="0.0.0.0", port="8000", threads=6, cert="", key=""):
run(app=web, host=host, port=port, server=CherryPyWSGI, quiet=True)
-def run_fcgi(host="0.0.0.0", port="8000"):
- from bottle import FlupFCGIServer
-
- run(app=web, host=host, port=port, server=FlupFCGIServer, quiet=True)
-
-
if __name__ == "__main__":
run(app=web, port=8001)