changeset 5378:b95d34820bc8

flup_frontend: fix wrapper class init to work for scgi and ajp (details below) I removed __init__ from wrapper class completely, it gave params to the wrapped __init__ that were not supported by all wrapped classes (esp. "multiplexed" and "umask", for ajp and scgi). The whole point of the wrapper's __init__ likely was to supply a better default value for the debug param, but our code explicitely passes in debug, so this default value is never used. Our code would even work as expected if it was used (same behaviour for debug=False and debug="off"). Another consequence of the __init__ removal is that some flup servers might use specific default values for some params now, e.g. for bindAddress: * localhost:8009 for AJP * localhost:4000 for SCGI If you don't like these defaults, you can still explicitely give --interface (and --port if needed). Removed some wrong references to CGI/FCGI scripts from generic parameter help strings.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 15 Dec 2009 03:42:25 +0100
parents 62984251a3cd
children a46c62d28c94
files MoinMoin/web/flup_frontend.py MoinMoin/web/frontend.py
diffstat 2 files changed, 4 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/web/flup_frontend.py	Mon Dec 14 00:52:03 2009 +0100
+++ b/MoinMoin/web/flup_frontend.py	Tue Dec 15 03:42:25 2009 +0100
@@ -42,7 +42,6 @@
 logging = log.getLogger(__name__)
 
 if have_flup:
-    from flup.server.fcgi_base import FCGI_RESPONDER
     class FlupFrontEnd(ServerFrontEnd):
         def add_options(self):
             super(FlupFrontEnd, self).add_options()
@@ -80,15 +79,8 @@
             WSGIServerWrapped = mod.WSGIServer
 
             class WSGIServer(WSGIServerWrapped):
-                def __init__(self, application, environ=None,
-                             multithreaded=True, multiprocess=False,
-                             bindAddress=None, umask=None, multiplexed=False,
-                             debug="off", roles=(FCGI_RESPONDER, )):
-                    WSGIServerWrapped.__init__(self, application, environ=environ,
-                                               multithreaded=multithreaded, multiprocess=multiprocess,
-                                               bindAddress=bindAddress, umask=umask, multiplexed=multiplexed,
-                                               debug=debug, roles=roles)
-
+                # note: base class uses debug=False as default. as we use string values,
+                # better explicitely pass in "off", "web" or "external".
                 def error(self, req):
                     """ Override the default handler, so it implements debug=web/external/off. """
                     if self.debug == 'external':
--- a/MoinMoin/web/frontend.py	Mon Dec 14 00:52:03 2009 +0100
+++ b/MoinMoin/web/frontend.py	Tue Dec 15 03:42:25 2009 +0100
@@ -50,11 +50,11 @@
         super(ServerFrontEnd, self).add_options()
         parser = self.parser
         parser.add_option("-p", "--port", dest="port", type="int",
-                          help="Set the port to listen on. If not given, act as CGI/FCGI script.")
+                          help="Set the port to listen on.")
         parser.add_option("-i", "--interface", dest="interface",
                           help=("Set the interface/socket to listen on. If starts "
                                 "with '/' or './' it is interpreted as a path "
-                                "to a unix socket. If not given, act as CGI/FCGI script."))
+                                "to a unix socket."))
         # Note: interface default MUST be None, do not set it to something else!
         # Otherwise CGI (and also when the FCGI process is spawned by the web server) won't work.