Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] Add autoindex_css_file option

Maxim Dounin
February 20, 2011 01:26PM
Hello!

On Sun, Feb 20, 2011 at 06:03:45PM +0100, Clément Bœsch wrote:

> Hi,
>
> I sent a while ago a patch on nginx mailing list, and recently realized
> it was the wrong place. So I took the time to update and fix the old patch
> for nginx current development version.
>
> This patch basically adds an autoindex_css_file option in order to allow
> some customizations in the index listing.
>
> One thing I'm not sure about is the ngx_alloc call; I didn't find any
> ngx_asprintf or such, but maybe there is some quicker/better way to do it.

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

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

Additionally, I personally believe that using css without making
sure page will be rendered in standards mode is bad idea.

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

Maxim Dounin

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Add autoindex_css_file option

Clément Bœsch 4013 February 20, 2011 12:04PM

Re: [PATCH] Add autoindex_css_file option

Clément Bœsch 950 February 20, 2011 12:10PM

Re: [PATCH] Add autoindex_css_file option

Maxim Dounin 928 February 20, 2011 01:26PM

Re: [PATCH] Add autoindex_css_file option

Clément Bœsch 876 February 20, 2011 03:48PM

Re: [PATCH] Add autoindex_css_file option

Maxim Dounin 909 February 20, 2011 07:10PM

Re: [PATCH] Add autoindex_css_file option

Clément Bœsch 967 February 20, 2011 07:22PM

Re: [PATCH] Add autoindex_css_file option

Maxim Dounin 1069 February 21, 2011 06:02AM

Re: [PATCH] Add autoindex_css_file option

Adrian Perez 979 February 21, 2011 07:40AM

Re: [PATCH] Add autoindex_css_file option

Clément Bœsch 919 February 23, 2011 04:22AM

Re: [PATCH] Add autoindex_css_file option

Clément Bœsch 1183 March 03, 2011 07:58PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 265
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready