diff options
author | Dmitry Volyntsev <xeioex@nginx.com> | 2018-12-28 12:42:29 +0300 |
---|---|---|
committer | Dmitry Volyntsev <xeioex@nginx.com> | 2018-12-28 12:42:29 +0300 |
commit | ea4c0e2e47030c8f3d4a3133cb624b5bf5e8e427 (patch) | |
tree | 4ffeaaf0b2a80b592e22375bb03d64a3a939058f /nginx/ngx_http_js_module.c | |
parent | fa888fd9a210fd4a2963ab68486e66e202fe33d9 (diff) | |
download | njs-ea4c0e2e47030c8f3d4a3133cb624b5bf5e8e427.tar.gz njs-ea4c0e2e47030c8f3d4a3133cb624b5bf5e8e427.zip |
njs_vm_run() is rectified.
Previously, both njs_vm_call() and njs_vm_run() can be used to run njs
code. njs_vm_call() was used to invoke a single function, while
njs_vm_run() was used to run global code as well to process the events.
At first invocation njs_vm_run() executed global code, all the next
invocations it processed pending events.
The solution is splitting njs_vm_run() into two functions. One for
events processing and another for running the global code.
Diffstat (limited to 'nginx/ngx_http_js_module.c')
-rw-r--r-- | nginx/ngx_http_js_module.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/nginx/ngx_http_js_module.c b/nginx/ngx_http_js_module.c index 3121bad3..3f86c7ee 100644 --- a/nginx/ngx_http_js_module.c +++ b/nginx/ngx_http_js_module.c @@ -913,7 +913,7 @@ ngx_http_js_init_vm(ngx_http_request_t *r) cln->handler = ngx_http_js_cleanup_ctx; cln->data = ctx; - if (njs_vm_run(ctx->vm) == NJS_ERROR) { + if (njs_vm_start(ctx->vm) == NJS_ERROR) { njs_vm_retval_to_ext_string(ctx->vm, &exception); ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, |