Welcome! Log In Create A New Profile

Advanced

Re: [nginx] setting variable cause core when used by lua

soul11201
February 16, 2017 04:28AM
i think this is a feature not a bug

2017-02-16 16:01 GMT+08:00 洪志道 <hongzhidao@gmail.com>:

> Sorry, sent too much.
>
> 2017-02-16 16:00 GMT+08:00 洪志道 <hongzhidao@gmail.com>:
>
>> Hi!
>>
>> diff -r da46bfc484ef src/http/ngx_http_variables.c
>> --- a/src/http/ngx_http_variables.c Mon Feb 13 21:45:01 2017 +0300
>> +++ b/src/http/ngx_http_variables.c Wed Feb 08 10:31:53 2017 +0800
>> @@ -783,6 +783,10 @@
>> ssize_t s, *sp;
>> ngx_str_t val;
>>
>> + if (v->data == NULL) {
>> + return;
>> + }
>> +
>> val.len = v->len;
>> val.data = v->data;
>>
>>
>> The following will cause core file, I think it's better to deal with in
>> nginx.
>>
>> server {
>> listen 8000;
>>
>> location / {
>> content_by_lua_block {
>> ngx.var.limit_rate = size; # size is undefined.
>> ngx.say('hello lua');
>> }
>> }
>>
>>
>> ============== set handler in lua-module ============
>> if (value_type == LUA_TNIL) {
>> vv->valid = 0;
>> vv->not_found = 1;
>> vv->no_cacheable = 0;
>> vv->data = NULL;
>> vv->len = 0;
>>
>> } else {
>> vv->valid = 1;
>> vv->not_found = 0;
>> vv->no_cacheable = 0;
>>
>> vv->data = val;
>> vv->len = len;
>> }
>>
>> v->set_handler(r, vv, v->data);
>> ===============================================
>>
>> Thanks.
>> B.R.
>>
>
>
> _______________________________________________
> nginx-devel mailing list
> nginx-devel@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
>



--

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

[nginx] setting variable cause core when used by lua

karton 471 February 16, 2017 03:02AM

Re: [nginx] setting variable cause core when used by lua

karton 327 February 16, 2017 03:02AM

Re: [nginx] setting variable cause core when used by lua

soul11201 277 February 16, 2017 04:28AM



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

Online Users

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