Skip to content

Commit 0b6da3b

Browse files
chronolawzhuizhuhaomeng
authored andcommitted
feature: added ffi-based function 'ngx_http_lua_ffi_req_is_internal'.
1 parent e98f5c5 commit 0b6da3b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/ngx_http_lua_misc.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,17 @@ ngx_http_lua_ffi_set_resp_status(ngx_http_request_t *r, int status)
9999
}
100100

101101

102+
int
103+
ngx_http_lua_ffi_req_is_internal(ngx_http_request_t *r)
104+
{
105+
if (r->connection->fd == (ngx_socket_t) -1) {
106+
return NGX_HTTP_LUA_FFI_BAD_CONTEXT;
107+
}
108+
109+
return r->internal;
110+
}
111+
112+
102113
int
103114
ngx_http_lua_ffi_is_subrequest(ngx_http_request_t *r)
104115
{

0 commit comments

Comments
 (0)