Skip to content

Commit 4c7a13c

Browse files
committed
[misc] fix a potential memory leak bug and update README files.
1 parent 3c5a0ea commit 4c7a13c

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

README.CN.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,12 @@ nginx-http-flv-module包含了[nginx-rtmp-module](https://github.com/arut/nginx-
168168

169169
配置项`rtmp_auto_push``rtmp_auto_push_reconnect``rtmp_socket_dir`在Windows上不起作用,除了Windows 10 17063以及后续版本之外,因为多进程模式的`relay`需要Unix domain socket的支持,详情请参考[Unix domain socket on Windows 10](https://blogs.msdn.microsoft.com/commandline/2017/12/19/af_unix-comes-to-windows)
170170

171-
最好将配置项`worker_processes`设置为1,因为`ngx_rtmp_stat_module`在多进程模式下每次只能获取一个进程的统计数据。如果统计数据不重要,那么可以将它设置为大于1的数字,最好与CPU的核心数保持一致
171+
最好将配置项`worker_processes`设置为1,因为`ngx_rtmp_stat_module``ngx_rtmp_control_module`在多进程模式下有问题,另外,`vhost`功能在多进程模式下还有问题
172172

173-
worker_processes 4; #运行在Windows上时,设置为1,因为Windows不支持Unix domain socket
173+
worker_processes 1; #运行在Windows上时,设置为1,因为Windows不支持Unix domain socket
174174
#worker_processes auto; #1.3.8和1.2.5以及之后的版本
175175

176-
worker_cpu_affinity 0001 0010 0100 1000; #只能用于FreeBSD和Linux
176+
#worker_cpu_affinity 0001 0010 0100 1000; #只能用于FreeBSD和Linux
177177
#worker_cpu_affinity auto; #1.9.10以及之后的版本
178178

179179
error_log logs/error.log error;
@@ -306,3 +306,6 @@ nginx-http-flv-module包含了[nginx-rtmp-module](https://github.com/arut/nginx-
306306
}
307307
}
308308

309+
# Red Har Enterprise Linux 6(CentOS 6)和7(CentOS 7)上的rpm安装包已可用
310+
311+
详情见[nginx-http-flv-module-package](https://github.com/winshining/nginx-http-flv-module-package)

README.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,12 @@ Since some players don't support HTTP chunked transmission, it's better to speci
168168

169169
The directives `rtmp_auto_push`, `rtmp_auto_push_reconnect` and `rtmp_socket_dir` will not function on Windows except on Windows 10 17063 and later versions, because `relay` in multiple processes mode needs help of Unix domain socket, please refer to [Unix domain socket on Windows 10](https://blogs.msdn.microsoft.com/commandline/2017/12/19/af_unix-comes-to-windows) for details.
170170

171-
The directive `worker_processes` of value 1 is preferable to other values, because `ngx_rtmp_stat_module` can only get the statistics of one process at a time in multi-processes mode. If the statistics is unimportant, it can be set as number greater than 1, it is better to set it as the number of CPU cores.
171+
The directive `worker_processes` of value 1 is preferable to other values, because there are something wrong with `ngx_rtmp_stat_module` and `ngx_rtmp_control_module` in multi-processes mode, in addtion, `vhost` feature is not perfect in multi-processes mode yet.
172172

173-
worker_processes 4; #should be 1 for Windows, for it doesn't support Unix domain socket
173+
worker_processes 1; #should be 1 for Windows, for it doesn't support Unix domain socket
174174
#worker_processes auto; #from versions 1.3.8 and 1.2.5
175175

176-
worker_cpu_affinity 0001 0010 0100 1000; #only available on FreeBSD and Linux
176+
#worker_cpu_affinity 0001 0010 0100 1000; #only available on FreeBSD and Linux
177177
#worker_cpu_affinity auto; #from version 1.9.10
178178

179179
error_log logs/error.log error;
@@ -307,3 +307,6 @@ The directive `worker_processes` of value 1 is preferable to other values, becau
307307
}
308308
}
309309

310+
# rpm packages on Red Hat Enterprise Linux 6 (CentOS 6) and 7 (CentOS 7) are available
311+
312+
Please refer to [nginx-http-flv-module-package](https://github.com/winshining/nginx-http-flv-module-package).

ngx_rtmp_relay_module.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ ngx_rtmp_relay_create_connection(ngx_rtmp_conf_ctx_t *cctx, ngx_str_t* name,
470470
if (addr->sockaddr->sa_family == AF_UNIX) {
471471
client = ngx_pcalloc(pool, rctx->url.len + 8);
472472
if (client == NULL) {
473-
return NULL;
473+
goto clear;
474474
}
475475

476476
*ngx_cpymem(client, rctx->url.data,

0 commit comments

Comments
 (0)