diff options
author | Andrei Belov <defan@nginx.com> | 2019-11-14 19:29:00 +0300 |
---|---|---|
committer | Andrei Belov <defan@nginx.com> | 2019-11-14 19:29:00 +0300 |
commit | 7630539c44fcb188bba03a65af34e952a81f2f38 (patch) | |
tree | 2c80f0cd315cae8079a39ba98ed89e02b5e1931a /src/ruby/nxt_ruby.c | |
parent | 70c9f18b6e8b25850bce8eb1edba4d100c3e55d2 (diff) | |
parent | 0a27f137de776925a24406cf6961c550824c63a0 (diff) | |
download | unit-7630539c44fcb188bba03a65af34e952a81f2f38.tar.gz unit-7630539c44fcb188bba03a65af34e952a81f2f38.tar.bz2 |
Merged with the default branch.1.13.0-1
Diffstat (limited to 'src/ruby/nxt_ruby.c')
-rw-r--r-- | src/ruby/nxt_ruby.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/ruby/nxt_ruby.c b/src/ruby/nxt_ruby.c index ab9f7020..45d7a7aa 100644 --- a/src/ruby/nxt_ruby.c +++ b/src/ruby/nxt_ruby.c @@ -85,14 +85,16 @@ static nxt_int_t nxt_ruby_init(nxt_task_t *task, nxt_common_app_conf_t *conf) { int state, rc; - VALUE dummy, res; + VALUE res; nxt_unit_ctx_t *unit_ctx; nxt_unit_init_t ruby_unit_init; nxt_ruby_rack_init_t rack_init; + static char *argv[2] = { (char *) "NGINX_Unit", (char *) "-e0" }; + + RUBY_INIT_STACK ruby_init(); - Init_stack(&dummy); - ruby_init_loadpath(); + ruby_options(2, argv); ruby_script("NGINX_Unit"); rack_init.task = task; @@ -707,7 +709,8 @@ nxt_ruby_rack_result_body(VALUE result) } } else if (rb_respond_to(body, rb_intern("each"))) { - rb_iterate(rb_each, body, nxt_ruby_rack_result_body_each, 0); + rb_block_call(body, rb_intern("each"), 0, 0, + nxt_ruby_rack_result_body_each, 0); } else { nxt_unit_req_error(nxt_ruby_run_ctx.req, |