Skip to content

Commit 3754757

Browse files
authored
change: we now print an alert when a non openresty-specific version of LuaJIT is detected since many optimizations would be missing.
1 parent 1a73e0a commit 3754757

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/ngx_http_lua_module.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,19 @@ ngx_http_lua_init(ngx_conf_t *cf)
746746
if (lmcf->lua == NULL) {
747747
dd("initializing lua vm");
748748

749+
#ifndef OPENRESTY_LUAJIT
750+
if (ngx_process != NGX_PROCESS_SIGNALLER && !ngx_test_config) {
751+
ngx_log_error(NGX_LOG_ALERT, cf->log, 0,
752+
"detected a LuaJIT version which is not OpenResty's"
753+
"; many optimizations will be disabled and "
754+
"performance will be compromised (see "
755+
"https://github.com/openresty/luajit2 for "
756+
"OpenResty's LuaJIT or, even better, consider using "
757+
"the OpenResty releases from https://openresty.org/"
758+
"en/download.html)");
759+
}
760+
#endif
761+
749762
ngx_http_lua_content_length_hash =
750763
ngx_http_lua_hash_literal("content-length");
751764
ngx_http_lua_location_hash = ngx_http_lua_hash_literal("location");

0 commit comments

Comments
 (0)