openresty / lua-nginx-module

Embed the Power of Lua into NGINX HTTP servers
https://openresty.org/
11.34k stars 2.03k forks source link

bugfix: the connection won't be closed normally when set arg[1] = "" before arg[2] = true #2302

Closed monkeyDluffy6017 closed 7 months ago

monkeyDluffy6017 commented 7 months ago

fix #2301

The reason is that when we set arg[1] = "" first, the lmcf->body_filter_chain will be null image https://github.com/openresty/lua-nginx-module/blob/master/src/ngx_http_lua_bodyfilterby.c#L633-L646

image https://github.com/openresty/lua-nginx-module/blob/master/src/ngx_http_lua_bodyfilterby.c#L668-L700

Then we can't set the right end flag image https://github.com/openresty/lua-nginx-module/blob/master/src/ngx_http_lua_bodyfilterby.c#L526-L549

monkeyDluffy6017 commented 7 months ago

The ci error seems it has nothing to do with my changes

monkeyDluffy6017 commented 7 months ago

@zhuizhuhaomeng @spacewander please help to review