[ANN] mod_wsgi draft

Manlio Perillo manlio_perillo at libero.it
Tue Sep 18 21:39:28 MSD 2007


Adrian Perez de Castro ha scritto:
> El Sat, 15 Sep 2007 20:40:44 +0200
 > [...]
> 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
>  

Look for the patchbomb extension:
http://hgbook.red-bean.com/hgbookch14.html#x18-31900014.4


>> 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 current version does not handle NGX_AGAIN, so you can't return a big 
result.

> 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
> 

I would prefer to define the old function as a macro.
Thanks for the report.

> 
> 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 :-)
> 

At the moment there are some trailing spaces that should be removed.

> 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.
> 

I'm using a Dell Inspirion 6400 with an Intel Core2 T7200, on Debian Etch.


Regards  Manlio Perillo





More information about the nginx mailing list