From c31773ea60c62efb558d89aa6c8abd44b2779a36 Mon Sep 17 00:00:00 2001 From: Vladimir Homutov Date: Mon, 4 Jul 2016 16:37:36 +0300 Subject: Stream: variables and script. This is a port of corresponding http code with unrelated features excluded. --- src/stream/ngx_stream_handler.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/stream/ngx_stream_handler.c') diff --git a/src/stream/ngx_stream_handler.c b/src/stream/ngx_stream_handler.c index aa69e4400..61169e1d0 100644 --- a/src/stream/ngx_stream_handler.c +++ b/src/stream/ngx_stream_handler.c @@ -149,6 +149,15 @@ ngx_stream_init_connection(ngx_connection_t *c) cmcf = ngx_stream_get_module_main_conf(s, ngx_stream_core_module); + s->variables = ngx_pcalloc(s->connection->pool, + cmcf->variables.nelts + * sizeof(ngx_stream_variable_value_t)); + + if (s->variables == NULL) { + ngx_stream_close_connection(c); + return; + } + if (cmcf->limit_conn_handler) { rc = cmcf->limit_conn_handler(s); -- cgit