[Web-SIG] WSGI mod_python wrapper
Robert Brewer
fumanchu at amor.org
Wed May 18 19:43:36 CEST 2005
Phillip J. Eby wrote:
> At 09:40 AM 5/18/2005 -0700, Robert Brewer wrote:
> > After much poring through many specs, I've got a WSGI wrapper for
> > mod_python that I'm fairly comfortable with. I'm sure PJE
> > will find 16 holes in it right away ;)
>
> Nope; not a one that I can see. Although I'm curious about
> your choice in send_headers() to include the content type
> and length headers in the headers_out. I had noticed that
> other variants of this implementation just called the
> set_content_X() methods and skipped adding the header.
> But I don't know enough about mod_python to have a clue
> which way is correct, or if it even matters.
I wasn't sure either. The mod_python docs say set_content_length() sets
the header for you. I figured the overkill was worth the extra cycles.
Apache's ap_set_content_type() function has this in a comment: "This
function must be called to set r->content_type in order for the
AddOutputFilterByType directive to work correctly." -- so it at least
has a separate purpose.
I don't think I'll change it unless someone shows the duplication is
harmful.
> I'd be happy to include this in wsgiref, assuming you're
> willing to license it as "PSF or ZPL" as is done for the
> rest of wsgiref.
PSF is fine, but I don't see any license terms in my CVS copy of
wsgiref. How shall I declare or include that?
> I'd prefer to call the module 'wsgiref.modpython_gateway', though.
Fine by me.
Robert Brewer
System Architect
Amor Ministries
fumanchu at amor.org
More information about the Web-SIG
mailing list