Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/check-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ jobs:
- name: Configure and make njs
run: |
./configure \
--debug=YES \
--cc-opt="$CC_OPT" \
--ld-opt="$LD_OPT" \
|| cat build/autoconf.err
Expand All @@ -81,6 +82,7 @@ jobs:
- name: Configure and make njs, 32-bit
run: |
./configure \
--debug=YES \
--cc-opt="$CC_OPT -m32" \
--ld-opt="$LD_OPT" \
|| cat build/autoconf.err
Expand All @@ -94,6 +96,7 @@ jobs:
- name: Configure and make njs with quickjs
run: |
./configure \
--debug=YES \
--with-quickjs \
--cc-opt="$CC_OPT -Iquickjs" \
--ld-opt="$LD_OPT -Lquickjs" \
Expand All @@ -108,6 +111,7 @@ jobs:
- name: Configure and make njs with quickjs-ng
run: |
./configure \
--debug=YES \
--with-quickjs \
--cc-opt="$CC_OPT" \
--ld-opt="$LD_OPT" \
Expand Down
4 changes: 2 additions & 2 deletions nginx/config
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ fi

if [ $HTTP != NO ]; then
ngx_module_type=HTTP_AUX_FILTER
ngx_module_name=ngx_http_js_module
ngx_module_name="ngx_http_js_module ngx_http_js_core_module"
ngx_module_incs="$ngx_addon_dir/../src $ngx_addon_dir/../build \
$NJS_QUICKJS_INC"
ngx_module_deps="$NJS_ENGINE_DEP $NJS_DEPS $QJS_DEPS"
Expand All @@ -174,7 +174,7 @@ fi

if [ $STREAM != NO ]; then
ngx_module_type=STREAM
ngx_module_name=ngx_stream_js_module
ngx_module_name="ngx_stream_js_module ngx_stream_js_core_module"
ngx_module_incs="$ngx_addon_dir/../src $ngx_addon_dir/../build \
$NJS_QUICKJS_INC"
ngx_module_deps="$NJS_ENGINE_DEP $NJS_DEPS $QJS_DEPS"
Expand Down
39 changes: 39 additions & 0 deletions nginx/ngx_http_js_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,42 @@ static ngx_command_t ngx_http_js_commands[] = {
};


static ngx_command_t ngx_js_core_commands[] = {

{ ngx_string("js_load_http_native_module"),
NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE13,
ngx_js_core_load_native_module,
0,
0,
NULL },

ngx_null_command
};


static ngx_core_module_t ngx_js_core_module_ctx = {
ngx_string("ngx_http_js_core"),
ngx_js_core_create_conf,
NULL
};


ngx_module_t ngx_http_js_core_module = {
NGX_MODULE_V1,
&ngx_js_core_module_ctx, /* module context */
ngx_js_core_commands, /* module directives */
NGX_CORE_MODULE, /* module type */
NULL, /* init master */
NULL, /* init module */
NULL, /* init process */
NULL, /* init thread */
NULL, /* exit thread */
NULL, /* exit process */
NULL, /* exit master */
NGX_MODULE_V1_PADDING
};


static ngx_http_module_t ngx_http_js_module_ctx = {
NULL, /* preconfiguration */
ngx_http_js_init, /* postconfiguration */
Expand Down Expand Up @@ -7760,6 +7796,9 @@ ngx_http_js_init_conf_vm(ngx_conf_t *cf, ngx_js_loc_conf_t *conf)
options.u.qjs.metas = ngx_http_js_uptr;
options.u.qjs.addons = njs_http_qjs_addon_modules;
options.clone = ngx_engine_qjs_clone;

options.core_conf = (ngx_js_core_conf_t *)
ngx_get_conf(cf->cycle->conf_ctx, ngx_http_js_core_module);
}
#endif

Expand Down
Loading
Loading