Merge lp:~deuns-martinez/loggerhead/flup into lp:loggerhead

Proposed by Denis Martinez
Status: Superseded
Proposed branch: lp:~deuns-martinez/loggerhead/flup
Merge into: lp:loggerhead
Diff against target: 40 lines (+21/-1)
2 files modified
loggerhead/config.py (+3/-0)
loggerhead/main.py (+18/-1)
To merge this branch: bzr merge lp:~deuns-martinez/loggerhead/flup
Reviewer Review Type Date Requested Status
Loggerhead Team Pending
Review via email: mp+15174@code.launchpad.net

This proposal has been superseded by a proposal from 2009-11-27.

To post a comment you must log in.
Revision history for this message
Denis Martinez (deuns-martinez) wrote :

Proposal to add FastCGI, SCGI and AJP support using flup.
This makes it usable under the Cherokee web server and others.

Revision history for this message
Matt Nordhoff (mnordhoff) wrote :

This looks nice to be, though I don't want to set up something to test it.

The (optional) flup dependency should be added to the README, but that's something than can be done when it's merged.

39 + return

That should be sys.exit(1), IMO.

Revision history for this message
Robert Collins (lifeless) wrote :

Matt, why sys.exit(1) rather than return? to get a non-zero exit code?

Revision history for this message
Matt Nordhoff (mnordhoff) wrote :

(Oops, didn't see this email.)

Robert Collins wrote:
> Matt, why sys.exit(1) rather than return? to get a non-zero exit code?

Yeah. Plus, it's consistent with the other code.

Revision history for this message
Martin Albisetti (beuno) wrote :

Denis, could you tweak these bits so we can merge?

lp:~deuns-martinez/loggerhead/flup updated
395. By Denis Martinez

sys.exit(1) instead of return

Revision history for this message
Denis Martinez (deuns-martinez) wrote :

Alright, it's done.

Unmerged revisions

395. By Denis Martinez

sys.exit(1) instead of return

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'loggerhead/config.py'
--- loggerhead/config.py 2009-10-17 08:47:38 +0000
+++ loggerhead/config.py 2009-11-23 22:55:19 +0000
@@ -46,6 +46,9 @@
46 "(defaults to 8080)."))46 "(defaults to 8080)."))
47 parser.add_option("--host", dest="user_host",47 parser.add_option("--host", dest="user_host",
48 help="Host Loggerhead should listen on.")48 help="Host Loggerhead should listen on.")
49 parser.add_option("--protocol", dest="protocol",
50 help=("Protocol to use: http, scgi, fcgi, ajp"
51 "(defaults to http)."))
49 parser.add_option("--memory-profile", action="store_true",52 parser.add_option("--memory-profile", action="store_true",
50 help="Profile the memory usage using Dozer.")53 help="Profile the memory usage using Dozer.")
51 parser.add_option("--prefix", dest="user_prefix",54 parser.add_option("--prefix", dest="user_prefix",
5255
=== modified file 'loggerhead/main.py'
--- loggerhead/main.py 2009-10-17 06:35:33 +0000
+++ loggerhead/main.py 2009-11-23 22:55:19 +0000
@@ -151,4 +151,21 @@
151 else:151 else:
152 host = config.get_option('user_host')152 host = config.get_option('user_host')
153153
154 httpserver.serve(app, host=host, port=port)154 if not config.get_option('protocol'):
155 protocol = 'http'
156 else:
157 protocol = config.get_option('protocol')
158
159 if protocol == 'http':
160 httpserver.serve(app, host=host, port=port)
161 else:
162 if protocol == 'fcgi':
163 from flup.server.fcgi import WSGIServer
164 elif protocol == 'scgi':
165 from flup.server.scgi import WSGIServer
166 elif protocol == 'ajp':
167 from flup.server.ajp import WSGIServer
168 else:
169 print >> sys.stderr, 'Unknown protocol: %s.' % (protocol)
170 return
171 WSGIServer(app, bindAddress=(host, int(port))).run()

Subscribers

People subscribed via source and target branches