On Sun, Feb 20, 2011 at 09:24:48PM +0300, Maxim Dounin wrote:
- You shouldn't use ngx_alloc() for request-related data. Using
ngx_palloc() is much easier and don't require free() (which is missed in your patch, btw).
Oups yeah sorry for the free, I should have spotted that. Ok for ngx_palloc.
- There is no need to do any separate allocs in this case,
changing main one (and relevant output code) in ngx_http_autoindex_handler() is enough.
Ok, patch updated to behave like this.
Additionally, I personally believe that using css without making sure page will be rendered in standards mode is bad idea.
I added a patch to make it HTML compliant (with a few warnings, but it's valid). I don't if it is really what you wanted though.
Also, I didn't add the prototype declaration since it's a static function; should I?
Generally style suggest that handler function should be kept first, and static functions are declared. Following any of these rules will require you to add declaration.
Though in this particular case there is no need to add function, see above.
Thank for your review. Patches re-attached. I don't know the commit politic here about mixing reindent so I made a different one for re-alignement. If I have to squash them I'll resend the patches.