diff src/stream/ngx_stream_handler.c @ 6607:c70b7f4537e1

Stream: variables and script. This is a port of corresponding http code with unrelated features excluded.
author Vladimir Homutov <vl@nginx.com>
date Mon, 04 Jul 2016 16:37:36 +0300
parents a01e315b3a78
children 164a0824ce20
line wrap: on
line diff
--- a/src/stream/ngx_stream_handler.c
+++ b/src/stream/ngx_stream_handler.c
@@ -149,6 +149,15 @@ ngx_stream_init_connection(ngx_connectio
 
     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);