aboutsummaryrefslogtreecommitdiff
path: root/nginx/ngx_http_js_module.c
diff options
context:
space:
mode:
authorDmitry Volyntsev <xeioex@nginx.com>2018-12-28 12:42:29 +0300
committerDmitry Volyntsev <xeioex@nginx.com>2018-12-28 12:42:29 +0300
commitea4c0e2e47030c8f3d4a3133cb624b5bf5e8e427 (patch)
tree4ffeaaf0b2a80b592e22375bb03d64a3a939058f /nginx/ngx_http_js_module.c
parentfa888fd9a210fd4a2963ab68486e66e202fe33d9 (diff)
downloadnjs-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.c2
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,