[ANN] mod_wsgi draft

Adrian Perez de Castro adrianperez at udc.es
Mon Sep 17 00:55:47 MSD 2007


El Sat, 15 Sep 2007 20:40:44 +0200
Manlio Perillo <manlio_perillo at libero.it> escribió:

> I hope that we can cooperate.
> If the interest about mod_wsgi is high, I can evalutate the
> possibility to move it to a better place, with a mailing list and a
> bug tracker.

I think there is no need to move development right now. Maybe in the
(near?) future, when more people gets interested (and I hope people
will be).

To access the code I installed Mercurial and it feels a lot like Bazaar
(with some differences, BTW), and I feel quite comfortable with it, so
I think I will be able of following your changes and sending patches
when appropriate :D
 
> I'm waiting your review!
> I hope that the code is easy to read, I'm not very fluent with C, and 
> with its coding styles (I'm a Python programmer).

I hadn't enough spare time, so I only did a small test-drive of it: I
built it with Nginx 0.6.11 and ran the example test script succesfully.
The module nearly builds with the 0.6.x sources, only a one-line change
is needed in ngx_http_wsgi_module.c (about line 476 in changeset #45):


diff -r 11aad9f59b05 src/ngx_http_wsgi_module.c
--- a/src/ngx_http_wsgi_module.c	Sat Sep 15 18:45:40 2007 +0200
+++ b/src/ngx_http_wsgi_module.c	Sun Sep 16 22:43:55 2007 +0200
@@ -473,7 +473,7 @@ ngx_http_wsgi_handler(ngx_http_request_t
   
   if (r->method == NGX_HTTP_GET || r->method == NGX_HTTP_HEAD) {
     /* XXX not sure */
-    rc = ngx_http_discard_body(r);
+    rc = ngx_http_discard_request_body(r);
   
     if (rc != NGX_OK && rc != NGX_AGAIN) {
       return rc;


It would be nice to have some proprocessor #define with the major,
minor and micro version numbers of Nginx, so we could do things like:

#if (NGINX_MAJOR >= 0) && (NGINX_MINOR >= 6)
  rc = ngx_http_discard_request_body(r);
#else
  rc = ngx_http_discard_body(r);
#endif


The header src/core/nginx.h already defines NGINX_VERSION which is a
string, so the autoconf scripts could extract components from it. Maybe
Igor agrees with approach or knows a better way of detecting the Nginx
version at compile time.

> I have used Emacs with gnu mode to edit the code.

Everyone will be able of using their preferred editor if indentation is
done consistently (i.e. always spaces or always tabs, without mixing
them). I use Vim and it looks right :-)

I hope to have some more time next week, stay tuned.

Best regards,


P.S. Just for the sake of completeness, my development machine is an
iBook G3 (PowerPC 750FX), with Gentoo GNU/Linux. I can do some testing
with the AMD64 machines we have at work if needed.

-- 
Adrian Perez de Castro               <adrianperez at udc.es>
Oficina de Software Libre     http://softwarelibre.udc.es
Universidade da Coruña                  http://www.udc.es
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://nginx.org/pipermail/nginx/attachments/20070916/0f2fc5e9/attachment.pgp>


More information about the nginx mailing list