Skip to content

Commit

Permalink
Stream phases
Browse files Browse the repository at this point in the history
  • Loading branch information
hfm committed Oct 11, 2016
1 parent 83d4acd commit 42a7c69
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/stream/ngx_stream_mruby_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 42a7c69

Please sign in to comment.