diff src/stream/ngx_stream_core_module.c @ 6221:7565e056fad6

Stream: the "tcp_nodelay" directive.
author Vladimir Homutov <vl@nginx.com>
date Mon, 10 Aug 2015 12:14:41 +0300
parents 68c106e6fa0a
children 2a621245f4cf
line wrap: on
line diff
--- a/src/stream/ngx_stream_core_module.c
+++ b/src/stream/ngx_stream_core_module.c
@@ -45,6 +45,13 @@ static ngx_command_t  ngx_stream_core_co
       0,
       NULL },
 
+    { ngx_string("tcp_nodelay"),
+      NGX_STREAM_MAIN_CONF|NGX_STREAM_SRV_CONF|NGX_CONF_FLAG,
+      ngx_conf_set_flag_slot,
+      NGX_STREAM_SRV_CONF_OFFSET,
+      offsetof(ngx_stream_core_srv_conf_t, tcp_nodelay),
+      NULL },
+
       ngx_null_command
 };
 
@@ -122,6 +129,7 @@ ngx_stream_core_create_srv_conf(ngx_conf
 
     cscf->file_name = cf->conf_file->file.name.data;
     cscf->line = cf->conf_file->line;
+    cscf->tcp_nodelay = NGX_CONF_UNSET;
 
     return cscf;
 }
@@ -148,6 +156,8 @@ ngx_stream_core_merge_srv_conf(ngx_conf_
         }
     }
 
+    ngx_conf_merge_value(conf->tcp_nodelay, prev->tcp_nodelay, 1);
+
     return NGX_CONF_OK;
 }