From 42a7c69cf5692e08c4ea345ad7dfa62c78e34e06 Mon Sep 17 00:00:00 2001 From: OKUMURA Takahiro Date: Wed, 12 Oct 2016 02:42:22 +0900 Subject: [PATCH] Stream phases see also: https://github.com/nginx/nginx/commit/05a455ff21aa7afd938bd45444e5d9c6d42b6c4c#diff-3c35d9fb310b1b20590a96876f815ea8L449 --- src/stream/ngx_stream_mruby_module.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/stream/ngx_stream_mruby_module.c b/src/stream/ngx_stream_mruby_module.c index 3231509d..0e1ddcf2 100644 --- a/src/stream/ngx_stream_mruby_module.c +++ b/src/stream/ngx_stream_mruby_module.c @@ -699,7 +699,19 @@ static ngx_int_t ngx_stream_mruby_init(ngx_conf_t *cf) { ngx_stream_core_main_conf_t *cmcf = ngx_stream_conf_get_module_main_conf(cf, ngx_stream_core_module); +#if (nginx_version < 1011005) cmcf->access_handler = ngx_stream_mruby_handler; +#else + ngx_stream_handler_pt *h; + ngx_stream_core_main_conf_t *cmcf = ngx_stream_conf_get_module_main_conf(cf, ngx_stream_core_module); + + h = ngx_array_push(&cmcf->phases[NGX_STREAM_ACCESS_PHASE].handlers); + if (h == NULL) { + return NGX_ERROR; + } + + *h = ngx_stream_mruby_handler; +#endif return NGX_OK; }