changeset 4532:65c0426f2b1f

flup cgi/fcgi adaptor: use None as interface default
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 03 Feb 2009 03:07:43 +0100
parents 83666cc9dc31
children 58ceb1d1c38d
files MoinMoin/web/flup_frontend.py MoinMoin/web/frontend.py
diffstat 2 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/web/flup_frontend.py	Mon Feb 02 05:54:21 2009 +0100
+++ b/MoinMoin/web/flup_frontend.py	Tue Feb 03 03:07:43 2009 +0100
@@ -78,8 +78,8 @@
 
             if options.port:
                 kwargs['bindAddress'] = (options.interface, options.port)
-            elif options.interface.startswith('/') or \
-                    options.interface.startswith('./'):
+            elif options.interface and (
+                 options.interface.startswith('/') or options.interface.startswith('./')):
                 kwargs['bindAddress'] = options.interface
 
             if options.min_spare and multi:
@@ -91,7 +91,7 @@
                     kwargs['maxThreads'] = options.max_childs
                 else:
                     kwargs['maxChildren'] = options.max_childs
-
+            logging.debug("WSGIServer(%r, %r)" % (application, kwargs))
             return WSGIServer(application, **kwargs).run()
 
     class CGIFrontEnd(FlupFrontEnd):
--- a/MoinMoin/web/frontend.py	Mon Feb 02 05:54:21 2009 +0100
+++ b/MoinMoin/web/frontend.py	Tue Feb 03 03:07:43 2009 +0100
@@ -53,12 +53,13 @@
         super(ServerFrontEnd, self).add_options()
         parser = self.parser
         parser.add_option("-p", "--port", dest="port", type="int",
-                          help="Set the port to listen on. Act as CGI/FCGI script otherwise")
+                          help="Set the port to listen on. If not given, act as CGI/FCGI script.")
         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. Default: localhost"))
-        parser.set_default('interface', 'localhost')
+                                "to a unix socket. If not given, act as CGI/FCGI script."))
+        # 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.
 
 class FrontEndNotAvailable(Exception):
     """ Raised if a frontend is not available for one reason or another. """