Welcome! Log In Create A New Profile

Advanced

Re: Variables in FreeBSD

Maxim Dounin
April 26, 2009 05:11PM
Hello!

On Sun, Apr 26, 2009 at 10:34:17AM -0400, dalspenguin wrote:

> Hello,
>
> I have created nginx module (compile by gcc) and found that nginx does not support VARIABLES on the FreeBSD os.
> I try to use it like
> ngx_str_t name = {r->variables[1].len, (unsigned char *) r->variables[1].data};
> However every time I get errors in the error.log file: signal 11
> It's works perfect on the Ubuntu os. I've read VARIABLES are not supported for the nginx 0.7.52. But I need to get the value of variables when I call my module from nginx.conf like
> set_module_value $returnedValue $incomingValue
> Could anyone help me to get a value from the variable $incomingValue on FreeBSD OS?
> Is there any way to get variable value on FreeBSD OS?

It's not really OS related. It's just the fact that your
broken code happend to work under Ubuntu for some reason.

You shouldn't even try to access r->variables by hand. Use
ngx_http_variables.[ch] functions instead.

If you know variable name at configuration stage, you should
probably use ngx_http_get_variable_index() during parsing config
and store returned index, and then use
ngx_http_get_indexed_variable() during request processing.

Multiple examples of variable usage may be found in various
official nginx modules, read source for details.

Maxim Dounin
Subject Author Posted

Variables in FreeBSD

dalspenguin April 26, 2009 10:34AM

Re: Variables in FreeBSD

Maxim Dounin April 26, 2009 05:11PM

Re: Variables in FreeBSD

dalspenguin April 27, 2009 01:40AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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