@@ -191,6 +191,20 @@ static ngx_command_t ngx_rtmp_core_commands[] = {
191191 offsetof(ngx_rtmp_core_srv_conf_t , buflen ),
192192 NULL },
193193
194+ { ngx_string ("tcp_nopush" ),
195+ NGX_RTMP_MAIN_CONF |NGX_RTMP_SRV_CONF |NGX_RTMP_APP_CONF |NGX_CONF_FLAG ,
196+ ngx_conf_set_flag_slot ,
197+ NGX_RTMP_APP_CONF_OFFSET ,
198+ offsetof(ngx_rtmp_core_app_conf_t , tcp_nopush ),
199+ NULL },
200+
201+ { ngx_string ("tcp_nodelay" ),
202+ NGX_RTMP_MAIN_CONF |NGX_RTMP_SRV_CONF |NGX_RTMP_APP_CONF |NGX_CONF_FLAG ,
203+ ngx_conf_set_flag_slot ,
204+ NGX_RTMP_APP_CONF_OFFSET ,
205+ offsetof(ngx_rtmp_core_app_conf_t , tcp_nodelay ),
206+ NULL },
207+
194208 { ngx_string ("send_timeout" ),
195209 NGX_RTMP_MAIN_CONF |NGX_RTMP_SRV_CONF |NGX_RTMP_APP_CONF |NGX_CONF_TAKE1 ,
196210 ngx_conf_set_msec_slot ,
@@ -485,6 +499,8 @@ ngx_rtmp_core_create_app_conf(ngx_conf_t *cf)
485499 return NULL ;
486500 }
487501
502+ conf -> tcp_nopush = NGX_CONF_UNSET ;
503+ conf -> tcp_nodelay = NGX_CONF_UNSET ;
488504 conf -> send_timeout = NGX_CONF_UNSET_MSEC ;
489505 conf -> send_lowat = NGX_CONF_UNSET_SIZE ;
490506 conf -> resolver_timeout = NGX_CONF_UNSET_MSEC ;
@@ -499,6 +515,9 @@ ngx_rtmp_core_merge_app_conf(ngx_conf_t *cf, void *parent, void *child)
499515 ngx_rtmp_core_app_conf_t * prev = parent ;
500516 ngx_rtmp_core_app_conf_t * conf = child ;
501517
518+ ngx_conf_merge_value (conf -> tcp_nopush , prev -> tcp_nopush , 0 );
519+ ngx_conf_merge_value (conf -> tcp_nodelay , prev -> tcp_nodelay , 1 );
520+
502521 ngx_conf_merge_msec_value (conf -> send_timeout , prev -> send_timeout , 60000 );
503522 ngx_conf_merge_size_value (conf -> send_lowat , prev -> send_lowat , 0 );
504523
0 commit comments