Welcome! Log In Create A New Profile

Advanced

Re: ngx_conf_set_str_array_slot() bug?

August 18, 2014 07:40PM
Great.

I was looking for some modules that use this handler (thanks to grep)
but it is not an easy task when we do not have an example of the
configuration.

Thanks a bunch,

On Mon, Aug 18, 2014 at 7:32 PM, Valentin V. Bartenev <vbart@nginx.com> wrote:
> On Monday 18 August 2014 18:04:26 Paulo Silva wrote:
>> Hi,
>> For a module with the following configuration
>>
>> /**
>> * do_nothing_tuple "val1" "val2";
>> */
>> static ngx_command_t ngx_http_do_nothing_commands[] = {
>>
>> {
>> ngx_string("do_nothing_tuple"),
>> NGX_HTTP_LOC_CONF | NGX_CONF_TAKE2,
>> ngx_conf_set_str_array_slot,
>> NGX_HTTP_LOC_CONF_OFFSET,
>> offsetof(ngx_http_do_nothing_loc_conf_t, tuple),
>> NULL
>> },
>>
>> ngx_null_command
>> };
>>
>> I was expecting that ngx_conf_set_str_array_slot() would create and
>> initialize an ngx_array_t with two elements (nelts == 2), the given
>> parameters, but it saves just the first element (see
>> http://fossies.org/dox/nginx-1.7.4/ngx__conf__file_8c_source.html#l01034).
>>
>> Is it a bug or ngx_conf_set_str_array_slot() use case is different?
>>
> [..]
>
> You may just look at the directives that use this function.
> For example: http://nginx.org/r/proxy_hide_header
>
> Typical configuration can be:
>
> proxy_hide_header X-Header-One;
> proxy_hide_header X-Header-Two;
>
> And it will result array with two elements: "X-Header-One"
> and "X-Header-Two".
>
> wbr, Valentin V. Bartenev
>
> _______________________________________________
> nginx-devel mailing list
> nginx-devel@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel



--
Paulo A. Silva
http://tech.pauloasilva.com
http://linkedin.com/in/devpauloasilva/

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

ngx_conf_set_str_array_slot() bug?

PauloASilva 803 August 18, 2014 01:06PM

Re: ngx_conf_set_str_array_slot() bug?

Valentin V. Bartenev 325 August 18, 2014 02:34PM

Re: ngx_conf_set_str_array_slot() bug?

PauloASilva 645 August 18, 2014 07:40PM



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

Online Users

Guests: 239
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