Skip to content

Commit e431196

Browse files
committed
feature: enabled FFI-based 'ngx.status' getter in ngx_stream_lua.
1 parent 530bd76 commit e431196

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/subsys/ngx_subsys_lua_misc.c.tt2

+7
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,13 @@ ngx_[% subsys %]_lua_ngx_req_is_internal(lua_State *L)
4040
lua_pushboolean(L, r->internal == 1);
4141
return 1;
4242
}
43+
[% END %]
4344

4445

4546
int
4647
ngx_[% subsys %]_lua_ffi_get_resp_status([% req_type %] *r)
4748
{
49+
[% IF http_subsys %]
4850
if (r->connection->fd == (ngx_socket_t) -1) {
4951
return NGX_[% SUBSYS %]_LUA_FFI_BAD_CONTEXT;
5052
}
@@ -61,9 +63,14 @@ ngx_[% subsys %]_lua_ffi_get_resp_status([% req_type %] *r)
6163
} else {
6264
return 0;
6365
}
66+
67+
[% ELSIF stream_subsys %]
68+
return r->session->status;
69+
[% END %]
6470
}
6571

6672

73+
[% IF http_subsys %]
6774
int
6875
ngx_[% subsys %]_lua_ffi_set_resp_status([% req_type %] *r, int status)
6976
{

0 commit comments

Comments
 (0)