aboutsummaryrefslogtreecommitdiff
path: root/src/stream/ngx_stream_handler.c
diff options
context:
space:
mode:
authorVladimir Homutov <vl@nginx.com>2016-07-04 16:37:36 +0300
committerVladimir Homutov <vl@nginx.com>2016-07-04 16:37:36 +0300
commitc31773ea60c62efb558d89aa6c8abd44b2779a36 (patch)
tree45bcc029fa8fc95b29f8e27fde33daeff66a3b19 /src/stream/ngx_stream_handler.c
parentdb5a15d2f92a592d0d312252c0294932a4bd6068 (diff)
downloadnginx-c31773ea60c62efb558d89aa6c8abd44b2779a36.tar.gz
nginx-c31773ea60c62efb558d89aa6c8abd44b2779a36.zip
Stream: variables and script.
This is a port of corresponding http code with unrelated features excluded.
Diffstat (limited to 'src/stream/ngx_stream_handler.c')
-rw-r--r--src/stream/ngx_stream_handler.c9
1 files changed, 9 insertions, 0 deletions
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);